changeset 5241:1536c6b80ff6

Use WORDS_BIG_ENDIAN, not BIG_ENDIAN. (Qmenu_bar): Declared. (DEFUN_ARGS_MANY, DEFUN_ARGS_UNEVALLED, DEFUN_ARGS_0,...): New macros. (DEFUN) [__STDC__]: Use those macros.
author Richard M. Stallman <rms@gnu.org>
date Thu, 23 Dec 1993 01:26:50 +0000
parents eed870591987
children 0e99ea9941e2
files src/lisp.h
diffstat 1 files changed, 31 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/lisp.h	Thu Dec 23 01:24:18 1993 +0000
+++ b/src/lisp.h	Thu Dec 23 01:26:50 1993 +0000
@@ -170,7 +170,7 @@
 
 #ifndef NO_UNION_TYPE
 
-#ifndef BIG_ENDIAN
+#ifndef WORDS_BIG_ENDIAN
 
 /* Definition of Lisp_Object for little-endian machines.  */
 
@@ -202,7 +202,7 @@
   }
 Lisp_Object;
 
-#else /* If BIG_ENDIAN */
+#else /* If WORDS_BIG_ENDIAN */
 
 typedef
 union Lisp_Object
@@ -232,7 +232,7 @@
   }
 Lisp_Object;
 
-#endif /* BIG_ENDIAN */
+#endif /* WORDS_BIG_ENDIAN */
 
 #endif /* NO_UNION_TYPE */
 
@@ -793,11 +793,38 @@
  `doc' is documentation for the user.
 */
 
+#ifndef __STDC__
 #define DEFUN(lname, fnname, sname, minargs, maxargs, prompt, doc) \
   Lisp_Object fnname (); \
   struct Lisp_Subr sname = {fnname, minargs, maxargs, lname, prompt, 0}; \
   Lisp_Object fnname
 
+#else
+
+/* This version of DEFUN declares a function prototype with the right
+   arguments, so we can catch errors with maxargs at compile-time. */
+#define DEFUN(lname, fnname, sname, minargs, maxargs, prompt, doc) \
+  Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \
+  struct Lisp_Subr sname = {fnname, minargs, maxargs, lname, prompt, 0}; \
+  Lisp_Object fnname
+
+/* Note that the weird token-substitution semantics of ANSI C makes
+   this work for MANY and UNEVALLED. */
+#define DEFUN_ARGS_MANY		(int, Lisp_Object *)
+#define DEFUN_ARGS_UNEVALLED	(Lisp_Object)
+#define DEFUN_ARGS_0	(void)
+#define DEFUN_ARGS_1	(Lisp_Object)
+#define DEFUN_ARGS_2	(Lisp_Object, Lisp_Object)
+#define DEFUN_ARGS_3	(Lisp_Object, Lisp_Object, Lisp_Object)
+#define DEFUN_ARGS_4	(Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object)
+#define DEFUN_ARGS_5	(Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, \
+			 Lisp_Object)
+#define DEFUN_ARGS_6	(Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, \
+			 Lisp_Object, Lisp_Object)
+#define DEFUN_ARGS_7	(Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, \
+			 Lisp_Object, Lisp_Object, Lisp_Object)
+#endif
+
 /* defsubr (Sname);
  is how we define the symbol for function `name' at start-up time. */
 extern void defsubr ();
@@ -1218,7 +1245,7 @@
 
 /* defined in keymap.c */
 
-extern Lisp_Object Qkeymap;
+extern Lisp_Object Qkeymap, Qmenu_bar;
 extern Lisp_Object current_global_map;
 extern Lisp_Object Fkey_description (), Fsingle_key_description ();
 extern Lisp_Object Fwhere_is_internal ();