From 3a27b17c7fea3845c63864e11008edf8cebd7e17 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Thu, 3 Mar 2016 17:11:28 -0800 Subject: Replace external dependencies on with an internal table Don't rely on the platform ; hopefully this can avoid problems. Signed-off-by: H. Peter Anvin --- nasm.h | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'nasm.h') diff --git a/nasm.h b/nasm.h index ff2acfe7..d50e6152 100644 --- a/nasm.h +++ b/nasm.h @@ -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. -- cgit v1.2.1