mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-30 06:50:31 +02:00
* snarf.h (SCM_INSITU, SCM_INIT): Resurrected.
This commit is contained in:
parent
4b4d0898a6
commit
73d8385e9f
1 changed files with 15 additions and 9 deletions
|
@ -51,15 +51,6 @@
|
|||
|
||||
|
||||
|
||||
/* Generic macros to be used in user macro definitions.
|
||||
*
|
||||
* For example, the SCM_PROC macro could have been defined by the user:
|
||||
*
|
||||
* #define SCM_PROC(RANAME, STR, REQ, OPT, VAR, CFN) \
|
||||
* SCM_NOTSNARF (static const char RANAME[]=STR) \
|
||||
* SCM_SNARFING (scm_make_gsubr (RANAME, REQ, OPT, VAR, (SCM_FUNC_CAST_ARBITRARY_ARGS) CFN))
|
||||
*/
|
||||
|
||||
#if defined(__cplusplus) || defined(GUILE_CPLUSPLUS_SNARF)
|
||||
#define SCM_FUNC_CAST_ARBITRARY_ARGS SCM (*)(...)
|
||||
#else
|
||||
|
@ -74,6 +65,21 @@
|
|||
# define SCM_SNARFING(X) X
|
||||
#endif
|
||||
|
||||
/* Generic macros to be used in user macro definitions.
|
||||
*
|
||||
* For example, in order to define a macro which creates ints and
|
||||
* initializes them to the result of foo (), do:
|
||||
*
|
||||
* #define SCM_FOO(NAME) \
|
||||
* SCM_INSITU (int NAME) \
|
||||
* SCM_INIT (NAME = foo ())
|
||||
*/
|
||||
|
||||
#define SCM_INSITU(X) SCM_NOTSNARF(X)
|
||||
#define SCM_INIT(X) SCM_SNARFING(\
|
||||
%%% X \
|
||||
)
|
||||
|
||||
#define SCM_DEFINE(FNAME, PRIMNAME, REQ, OPT, VAR, ARGLIST, DOCSTRING) \
|
||||
SCM_NOTSNARF(\
|
||||
static const char s_ ## FNAME [] = PRIMNAME; \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue