diff options
Diffstat (limited to 'src/lisp.h')
-rw-r--r-- | src/lisp.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lisp.h b/src/lisp.h index 76a9ed8f159..87bc3efd198 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2803,6 +2803,15 @@ enum maxargs UNEVALLED = -1 }; +/* Call a function F that accepts many args, passing it ARRAY's elements. */ +#define CALLMANY(f, array) (f) (ARRAYELTS (array), array) + +/* Call a function F that accepts many args, passing it the remaining args, + E.g., 'return CALLN (Fformat, fmt, text);' is less error-prone than + '{ Lisp_Object a[2]; a[0] = fmt; a[1] = text; return Fformat (2, a); }'. + CALLN is overkill for simple usages like 'Finsert (1, &text);'. */ +#define CALLN(f, ...) CALLMANY (f, ((Lisp_Object []) {__VA_ARGS__})) + extern void defvar_lisp (struct Lisp_Objfwd *, const char *, Lisp_Object *); extern void defvar_lisp_nopro (struct Lisp_Objfwd *, const char *, Lisp_Object *); extern void defvar_bool (struct Lisp_Boolfwd *, const char *, bool *); |