diff options
Diffstat (limited to 'src/lisp.h')
| -rw-r--r-- | src/lisp.h | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/lisp.h b/src/lisp.h index 65335fbc052..170da67c61c 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -4609,27 +4609,29 @@ enum | |||
| 4609 | STACK_CONS (d, Qnil)))) \ | 4609 | STACK_CONS (d, Qnil)))) \ |
| 4610 | : list4 (a, b, c, d)) | 4610 | : list4 (a, b, c, d)) |
| 4611 | 4611 | ||
| 4612 | /* Check whether stack-allocated strings are ASCII-only. */ | 4612 | /* Declare NAME as an auto Lisp string if possible, a GC-based one if not. |
| 4613 | Take its unibyte value from the null-terminated string STR, | ||
| 4614 | an expression that should not have side effects. | ||
| 4615 | STR's value is not necessarily copied. The resulting Lisp string | ||
| 4616 | should not be modified or made visible to user code. */ | ||
| 4613 | 4617 | ||
| 4614 | #if defined (ENABLE_CHECKING) && USE_STACK_LISP_OBJECTS | 4618 | #define AUTO_STRING(name, str) \ |
| 4615 | extern const char *verify_ascii (const char *); | 4619 | AUTO_STRING_WITH_LEN (name, str, strlen (str)) |
| 4616 | #else | ||
| 4617 | # define verify_ascii(str) (str) | ||
| 4618 | #endif | ||
| 4619 | 4620 | ||
| 4620 | /* Declare NAME as an auto Lisp string if possible, a GC-based one if not. | 4621 | /* Declare NAME as an auto Lisp string if possible, a GC-based one if not. |
| 4621 | Take its value from STR. STR is not necessarily copied and should | 4622 | Take its unibyte value from the null-terminated string STR with length LEN. |
| 4622 | contain only ASCII characters. The resulting Lisp string should | 4623 | STR may have side effects and may contain null bytes. |
| 4623 | not be modified or made visible to user code. */ | 4624 | STR's value is not necessarily copied. The resulting Lisp string |
| 4625 | should not be modified or made visible to user code. */ | ||
| 4624 | 4626 | ||
| 4625 | #define AUTO_STRING(name, str) \ | 4627 | #define AUTO_STRING_WITH_LEN(name, str, len) \ |
| 4626 | Lisp_Object name = \ | 4628 | Lisp_Object name = \ |
| 4627 | (USE_STACK_STRING \ | 4629 | (USE_STACK_STRING \ |
| 4628 | ? (make_lisp_ptr \ | 4630 | ? (make_lisp_ptr \ |
| 4629 | ((&(union Aligned_String) \ | 4631 | ((&(union Aligned_String) \ |
| 4630 | {{strlen (str), -1, 0, (unsigned char *) verify_ascii (str)}}.s), \ | 4632 | {{len, -1, 0, (unsigned char *) (str)}}.s), \ |
| 4631 | Lisp_String)) \ | 4633 | Lisp_String)) \ |
| 4632 | : build_string (verify_ascii (str))) | 4634 | : make_unibyte_string (str, len)) |
| 4633 | 4635 | ||
| 4634 | /* Loop over all tails of a list, checking for cycles. | 4636 | /* Loop over all tails of a list, checking for cycles. |
| 4635 | FIXME: Make tortoise and n internal declarations. | 4637 | FIXME: Make tortoise and n internal declarations. |