diff options
author | H. Peter Anvin <hpa@zytor.com> | 2016-03-03 17:11:28 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2016-03-03 17:18:38 -0800 |
commit | 3a27b17c7fea3845c63864e11008edf8cebd7e17 (patch) | |
tree | 4e8ab085247347eddf76fe242b76198d8e6332c1 /nasm.h | |
parent | a9a1b5c318e7bcb7680483c51933c6f3d6c69cd9 (diff) | |
download | nasm-ctype.tar.gz |
Replace external dependencies on <ctype.h> with an internal tablectype
Don't rely on the platform <ctype.h>; hopefully this can avoid
problems.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'nasm.h')
-rw-r--r-- | nasm.h | 21 |
1 files changed, 5 insertions, 16 deletions
@@ -428,25 +428,14 @@ extern struct preproc_ops preproc_nop; * decorator. E.g. {rn-sae}, {1to8}, {k1}{z} */ -#define isidstart(c) (nasm_isalpha(c) || \ - (c) == '_' || \ - (c) == '.' || \ - (c) == '?' || \ - (c) == '@') - -#define isidchar(c) (isidstart(c) || \ - nasm_isdigit(c) || \ - (c) == '$' || \ - (c) == '#' || \ - (c) == '~') - -#define isbrcchar(c) (isidchar(c) || \ - (c) == '-') +#define isidstart(c) ((nasm_ctype_tab[(unsigned char)c] & 0x60) >= 0x60) +#define isidchar(c) ((nasm_ctype_tab[(unsigned char)c] & 0x60) >= 0x40) +#define isbrcchar(c) ((nasm_ctype_tab[(unsigned char)c] & 0x60) >= 0x20) /* Ditto for numeric constants. */ -#define isnumstart(c) (nasm_isdigit(c) || (c) == '$') -#define isnumchar(c) (nasm_isalnum(c) || (c) == '_') +#define isnumstart(c) (!!(nasm_ctype_tab[(unsigned char)c] & 0x80)) +#define isnumchar(c) nasm_isalnum(c) /* * Data-type flags that get passed to listing-file routines. |