Subject: bug#15880: Compute C declarations for DEFSYMs automatically.

From: Paul Eggert <[email-masked]>
Date: Mon, 05 Jan 2015 14:20:01 -0800

On 01/05/2015 11:48 AM, Eli Zaretskii wrote:
> I don't understand how this:
>
>    #define lisp_h_XSYMBOL(a) \
>       (eassert (SYMBOLP (a)), \
>        (struct Lisp_Symbol *) XUNTAGBASE (a, Lisp_Symbol, lispsym))
>    # define XSYMBOL(a) lisp_h_XSYMBOL (a)
>
> and this:
>
>    INLINE struct Lisp_Symbol *XSYMBOL (Lisp_Object);
>
> can live together.  Can you explain?

Ah, I see the problem now: I was compiling with optimization and you're 
not.  I installed the attached patch to fix that.  When optimizing, 
XSYMBOL is not defined as a macro.
>From b8b71fa23d12cf5b0bd01f22be414a5067aadd47 Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email-masked]>
Date: Mon, 5 Jan 2015 14:15:59 -0800
Subject: [PATCH] * lisp.h (XSYMBOL): Parenthesize id in forward decl.

Needed when neither optimizing nor inlining.
Also, sort decls alphabetically.
---
 src/ChangeLog | 6 ++++++
 src/lisp.h    | 4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/ChangeLog b/src/ChangeLog
index 8cc775b..69da1c3 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2015-01-05  Paul Eggert  <[email-masked]>
+
+	* lisp.h (XSYMBOL): Parenthesize id in forward decl.
+	Needed when neither optimizing nor inlining.
+	Also, sort decls alphabetically.
+
 2015-01-05  Eli Zaretskii  <[email-masked]>
 
 	* w32proc.c, w32.h, w32fns.c, w32font.c, w32menu.c, w32notify.c:
diff --git a/src/lisp.h b/src/lisp.h
index fc04ab9..1f18b5e 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -609,10 +609,10 @@ INLINE bool SUB_CHAR_TABLE_P (Lisp_Object);
 INLINE bool SUBRP (Lisp_Object);
 INLINE bool (SYMBOLP) (Lisp_Object);
 INLINE bool (VECTORLIKEP) (Lisp_Object);
-INLINE struct Lisp_Symbol *XSYMBOL (Lisp_Object);
-INLINE void *(XUNTAGBASE) (Lisp_Object, int, void *);
 INLINE bool WINDOWP (Lisp_Object);
 INLINE struct Lisp_Save_Value *XSAVE_VALUE (Lisp_Object);
+INLINE struct Lisp_Symbol *(XSYMBOL) (Lisp_Object);
+INLINE void *(XUNTAGBASE) (Lisp_Object, int, void *);
 
 /* Defined in chartab.c.  */
 extern Lisp_Object char_table_ref (Lisp_Object, int);
-- 
2.1.0