diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lisp.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/lisp.h b/src/lisp.h index eb78176aed6..db886c65204 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -303,6 +303,9 @@ DEFINE_GDB_SYMBOL_END (VALMASK) | |||
| 303 | 303 | ||
| 304 | #define LISP_WORDS_ARE_POINTERS (EMACS_INT_MAX == INTPTR_MAX) | 304 | #define LISP_WORDS_ARE_POINTERS (EMACS_INT_MAX == INTPTR_MAX) |
| 305 | #if LISP_WORDS_ARE_POINTERS | 305 | #if LISP_WORDS_ARE_POINTERS |
| 306 | /* TAG_PTR casts to Lisp_Word and can be used in static initializers, | ||
| 307 | so this typedef assumes static initializers can contain casts to pointers. | ||
| 308 | All Emacs targets support this extension to the C standard. */ | ||
| 306 | typedef struct Lisp_X *Lisp_Word; | 309 | typedef struct Lisp_X *Lisp_Word; |
| 307 | #else | 310 | #else |
| 308 | typedef EMACS_INT Lisp_Word; | 311 | typedef EMACS_INT Lisp_Word; |
| @@ -931,12 +934,14 @@ typedef EMACS_UINT Lisp_Word_tag; | |||
| 931 | #define LISP_WORD_TAG(tag) \ | 934 | #define LISP_WORD_TAG(tag) \ |
| 932 | ((Lisp_Word_tag) (tag) << (USE_LSB_TAG ? 0 : VALBITS)) | 935 | ((Lisp_Word_tag) (tag) << (USE_LSB_TAG ? 0 : VALBITS)) |
| 933 | 936 | ||
| 934 | /* An initializer for a Lisp_Object that contains TAG along with PTR. */ | 937 | /* An initializer for a Lisp_Object that contains TAG along with P. |
| 935 | #define TAG_PTR(tag, ptr) \ | 938 | P can be a pointer or an integer. The result is usable in a static |
| 936 | LISP_INITIALLY ((Lisp_Word) ((uintptr_t) (ptr) + LISP_WORD_TAG (tag))) | 939 | initializer if TAG and P are both integer constant expressions. */ |
| 940 | #define TAG_PTR(tag, p) \ | ||
| 941 | LISP_INITIALLY ((Lisp_Word) ((uintptr_t) (p) + LISP_WORD_TAG (tag))) | ||
| 937 | 942 | ||
| 938 | /* LISPSYM_INITIALLY (Qfoo) is equivalent to Qfoo except it is | 943 | /* LISPSYM_INITIALLY (Qfoo) is equivalent to Qfoo except it is |
| 939 | designed for use as an initializer, even for a constant initializer. */ | 944 | designed for use as a (possibly static) initializer. */ |
| 940 | #define LISPSYM_INITIALLY(name) \ | 945 | #define LISPSYM_INITIALLY(name) \ |
| 941 | TAG_PTR (Lisp_Symbol, (intptr_t) ((i##name) * sizeof *lispsym)) | 946 | TAG_PTR (Lisp_Symbol, (intptr_t) ((i##name) * sizeof *lispsym)) |
| 942 | 947 | ||