summaryrefslogtreecommitdiff
path: root/libguile/gsubr.h
diff options
context:
space:
mode:
authorDaniel Llorens <lloda@sarc.name>2020-01-03 11:59:03 +0100
committerDaniel Llorens <lloda@sarc.name>2020-01-03 12:45:07 +0100
commit6b0491233f6b7e3ca2743ec43340a2ed04ac845e (patch)
treed06cbb12780f59a05e1850908e3a732e44fd64c7 /libguile/gsubr.h
parent2041cd88fc9ebb673ee9cd4d8679d22011b6bd88 (diff)
downloadguile-6b0491233f6b7e3ca2743ec43340a2ed04ac845e.tar.gz
Provide SCM_DEFINE_STATIC
From guile-gnome:plain/glib/gnome/gobject/private.h. * libguile/gsubr.h (SCM_DEFINE_STATIC): As stated.
Diffstat (limited to 'libguile/gsubr.h')
-rw-r--r--libguile/gsubr.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/libguile/gsubr.h b/libguile/gsubr.h
index 91a1104b6..462286c48 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, \