diff options
Diffstat (limited to 'src/lisp.h')
| -rw-r--r-- | src/lisp.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lisp.h b/src/lisp.h index e96fcfe94d3..17495777378 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -1024,6 +1024,20 @@ builtin_lisp_symbol (int index) | |||
| 1024 | return make_lisp_symbol (&lispsym[index]); | 1024 | return make_lisp_symbol (&lispsym[index]); |
| 1025 | } | 1025 | } |
| 1026 | 1026 | ||
| 1027 | INLINE bool | ||
| 1028 | c_symbol_p (struct Lisp_Symbol *sym) | ||
| 1029 | { | ||
| 1030 | char *bp = (char *) lispsym; | ||
| 1031 | char *sp = (char *) sym; | ||
| 1032 | if (PTRDIFF_MAX < INTPTR_MAX) | ||
| 1033 | return bp <= sp && sp < bp + sizeof lispsym; | ||
| 1034 | else | ||
| 1035 | { | ||
| 1036 | ptrdiff_t offset = sp - bp; | ||
| 1037 | return 0 <= offset && offset < sizeof lispsym; | ||
| 1038 | } | ||
| 1039 | } | ||
| 1040 | |||
| 1027 | INLINE void | 1041 | INLINE void |
| 1028 | (CHECK_SYMBOL) (Lisp_Object x) | 1042 | (CHECK_SYMBOL) (Lisp_Object x) |
| 1029 | { | 1043 | { |