guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 01/02: Provide SCM_DEFINE_STATIC


From: Daniel Llorens
Subject: [Guile-commits] 01/02: Provide SCM_DEFINE_STATIC
Date: Fri, 3 Jan 2020 06:45:40 -0500 (EST)

lloda pushed a commit to branch master
in repository guile.

commit 6b0491233f6b7e3ca2743ec43340a2ed04ac845e
Author: Daniel Llorens <address@hidden>
Date:   Fri Jan 3 11:59:03 2020 +0100

    Provide SCM_DEFINE_STATIC
    
    From guile-gnome:plain/glib/gnome/gobject/private.h.
    
    * libguile/gsubr.h (SCM_DEFINE_STATIC): As stated.
---
 libguile/gsubr.h | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/libguile/gsubr.h b/libguile/gsubr.h
index 91a1104..462286c 100644
--- a/libguile/gsubr.h
+++ b/libguile/gsubr.h
@@ -93,7 +93,6 @@ SCM_SNARF_DOCS(primitive, FNAME, PRIMNAME, ARGLIST, REQ, OPT, 
VAR, DOCSTRING)
 /* Always use the generic subr case.  */
 #define SCM_DEFINE SCM_DEFINE_GSUBR
 
-
 #define SCM_PRIMITIVE_GENERIC(FNAME, PRIMNAME, REQ, OPT, VAR, ARGLIST, 
DOCSTRING) \
 SCM_SNARF_HERE(\
 SCM_UNUSED static const char s_ ## FNAME [] = PRIMNAME; \
@@ -120,6 +119,17 @@ scm_c_export (s_ ## FNAME, NULL); \
 )\
 SCM_SNARF_DOCS(primitive, FNAME, PRIMNAME, ARGLIST, REQ, OPT, VAR, DOCSTRING)
 
+#define SCM_DEFINE_STATIC(FNAME, PRIMNAME, REQ, OPT, VAR, ARGLIST, DOCSTRING) \
+SCM_SNARF_HERE(\
+static const char s_ ## FNAME [] = PRIMNAME; \
+static SCM FNAME ARGLIST\
+)\
+SCM_SNARF_INIT(\
+scm_c_define_gsubr (s_ ## FNAME, REQ, OPT, VAR, \
+                    (SCM_FUNC_CAST_ARBITRARY_ARGS) FNAME); \
+)\
+SCM_SNARF_DOCS(primitive, FNAME, PRIMNAME, ARGLIST, REQ, OPT, VAR, DOCSTRING)
+
 #define SCM_PROC(RANAME, STR, REQ, OPT, VAR, CFN)  \
 SCM_SNARF_HERE(SCM_UNUSED static const char RANAME[]=STR) \
 SCM_SNARF_INIT(scm_c_define_gsubr (RANAME, REQ, OPT, VAR, \



reply via email to

[Prev in Thread] Current Thread [Next in Thread]