Ar an t-ochtú lá déag de mí Méan Fómhair, scríobh Jerry James:
On Sat, Sep 18, 2010 at 11:04 AM, Aidan Kehoe
<kehoea(a)parhasard.net> wrote:
> 2010-09-18 Aidan Kehoe <kehoea(a)parhasard.net>
>
> * lisp.h (PARSE_KEYWORDS):
> Turns out #elsif is not valid preprocessor syntax, who knew!
On the other hand, #elif is valid preprocessor syntax. I'd rather see
this patch reverted, and just change #elsif -> #elif.
The NEW_GC implementation unfortunately means the S##Ffunction_name pointer
is not available after compile time. This has the result that
GET_DEFUN_LISP_OBJECT is broken in a normal XEmacs invocation under NEW_GC,
which means that there are a couple of silent bugs in gpmevent.c and
tooltalk.c, and, more relevantly to me, that the compile failed on the first
call of #'make-hash-table. I’ve committed the below, which removes the need
for the #elif, and fixes some indentation issues.
APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1285021370 -3600
# Node ID 59a6419f75046951fcebc865c29222d1c21fe895
# Parent d0bc331e433f81324b6959493c0d1420017e02d5
Use GET_DEFUN_LISP_OBJECT() in PARSE_KEYWORDS(), fix former under NEW_GC.
2010-09-20 Aidan Kehoe <kehoea(a)parhasard.net>
* lisp.h (GET_DEFUN_LISP_OBJECT): Make the NEW_GC version of this
work, remove a needless and unhelpful semicolon.
(GET_DEFUN_LISP_OBJECT): Remove a needless semicolon from the
non-NEW_GC version of this.
(PARSE_KEYWORDS): Fix the indentation for the DEBUG_XEMACS
version of this macro.
(PARSE_KEYWORDS): Use GET_DEFUN_LISP_OBJECT() for both the NEW_GC
and non-NEW_GC versions of this macro, when working out the
function's min args.
diff -r d0bc331e433f -r 59a6419f7504 src/ChangeLog
--- a/src/ChangeLog Sat Sep 18 18:02:28 2010 +0100
+++ b/src/ChangeLog Mon Sep 20 23:22:50 2010 +0100
@@ -1,3 +1,15 @@
+2010-09-20 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * lisp.h (GET_DEFUN_LISP_OBJECT): Make the NEW_GC version of this
+ work, remove a needless and unhelpful semicolon.
+ (GET_DEFUN_LISP_OBJECT): Remove a needless semicolon from the
+ non-NEW_GC version of this.
+ (PARSE_KEYWORDS): Fix the indentation for the DEBUG_XEMACS
+ version of this macro.
+ (PARSE_KEYWORDS): Use GET_DEFUN_LISP_OBJECT() for both the NEW_GC
+ and non-NEW_GC versions of this macro, when working out the
+ function's min args.
+
2010-09-18 Aidan Kehoe <kehoea(a)parhasard.net>
* lisp.h (PARSE_KEYWORDS):
diff -r d0bc331e433f -r 59a6419f7504 src/lisp.h
--- a/src/lisp.h Sat Sep 18 18:02:28 2010 +0100
+++ b/src/lisp.h Mon Sep 20 23:22:50 2010 +0100
@@ -3404,7 +3404,7 @@
static struct Lisp_Subr *S##Fname; \
DOESNT_RETURN_TYPE (Lisp_Object) Fname (DEFUN_##max_args arglist)
#define GET_DEFUN_LISP_OBJECT(Fname) \
- wrap_subr (S##Fname);
+ wrap_subr (&MC_ALLOC_S##Fname)
#else /* not NEW_GC */
#define DEFUN(lname, Fname, min_args, max_args, prompt, arglist) \
Lisp_Object Fname (EXFUN_##max_args); \
@@ -3444,7 +3444,7 @@
}; \
DOESNT_RETURN_TYPE (Lisp_Object) Fname (DEFUN_##max_args arglist)
#define GET_DEFUN_LISP_OBJECT(Fname) \
- wrap_subr (&S##Fname);
+ wrap_subr (&S##Fname)
#endif /* not NEW_GC */
/* Heavy ANSI C preprocessor hackery to get DEFUN to declare a
@@ -3544,30 +3544,23 @@
#define PARSE_KEYWORDS(function, nargs, args, keyword_count, keywords, \
keyword_defaults) \
- PARSE_KEYWORDS_8 (intern_massaging_name (1 + #function), \
- nargs, args, \
- keyword_count, keywords, \
- keyword_defaults, \
- /* Can't XSUBR (Fsymbol_function (...))->min_args, \
- the function may be advised. */ \
- XINT (Ffunction_min_args \
- (intern_massaging_name (1 + #function))), \
- 0); \
- assert (0 == strcmp (__func__, #function))
+ PARSE_KEYWORDS_8 (intern_massaging_name (1 + #function), nargs, args, \
+ keyword_count, keywords, keyword_defaults, \
+ /* Can't XSUBR (Fsymbol_function (...))->min_args, \
+ the function may be advised. */ \
+ XINT (Ffunction_min_args \
+ (intern_massaging_name (1 + #function))), \
+ 0); \
+ assert (0 == strcmp (__func__, #function))
#else /* defined (DEBUG_XEMACS) && ... */
-#ifdef NEW_GC
#define PARSE_KEYWORDS(function, nargs, args, keyword_count, keywords, \
keyword_defaults) \
- PARSE_KEYWORDS_8 (intern (S##function->name), nargs, args, \
- keyword_count, keywords, \
- keyword_defaults, S##function->min_args, 0)
-#else /* NEW_GC */
-#define PARSE_KEYWORDS(function, nargs, args, keyword_count, keywords, \
- keyword_defaults) \
- PARSE_KEYWORDS_8 (intern (S##function.name), nargs, args, \
- keyword_count, keywords, \
- keyword_defaults, S##function.min_args, 0)
-#endif /* NEW_GC */
+ PARSE_KEYWORDS_8 (intern (subr_name (XSUBR \
+ (GET_DEFUN_LISP_OBJECT (function)))), \
+ nargs, args, keyword_count, keywords, \
+ keyword_defaults, \
+ XSUBR (GET_DEFUN_LISP_OBJECT (function))->min_args, \
+ 0)
#endif /* defined (DEBUG_XEMACS) && defined (__STDC_VERSION__) ... */
/* PARSE_KEYWORDS_8 is a more fine-grained version of PARSE_KEYWORDS. The
diff -r d0bc331e433f -r 59a6419f7504 src/symeval.h
--- a/src/symeval.h Sat Sep 18 18:02:28 2010 +0100
+++ b/src/symeval.h Mon Sep 20 23:22:50 2010 +0100
@@ -294,6 +294,9 @@
#define DEFSUBR(Fname) \
do { \
+ /* #### As far as I can see, this has no upside compared to the non-NEW_GC \
+ code. The MC_ALLOC_S##Fname structure is also in the dumped \
+ XEmacs. Aidan Kehoe, Mon Sep 20 23:14:01 IST 2010 */ \
DEFSUBR_MC_ALLOC (Fname); \
defsubr (S##Fname); \
} while (0)
--
“Apart from the nine-banded armadillo, man is the only natural host of
Mycobacterium leprae, although it can be grown in the footpads of mice.”
-- Kumar & Clark, Clinical Medicine, summarising improbable leprosy research
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/mailman/listinfo/xemacs-patches