From e2e5d361cfc8bf2f19a78661b9c1d3f7cc9ecde5 Mon Sep 17 00:00:00 2001 From: Martin Nilsson <nilsson@opera.com> Date: Wed, 3 Sep 2014 23:32:45 +0200 Subject: [PATCH] Moved the WIDE_* macros to stralloc since they have nothing to do with portability. --- src/port.h | 11 ----------- src/stralloc.h | 10 ++++++++++ 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/port.h b/src/port.h index ec839a4615..2750407074 100644 --- a/src/port.h +++ b/src/port.h @@ -106,17 +106,6 @@ struct timeval; #define HAVE_ISSPACE 1 #define ISSPACE(X) isspace(X) -/* Warning, these run 'C' more than once */ -/* FIXME: Is it that great that every wide char is considered an - * identifier char? Doesn't strike me as very unicode compliant. - * isalnum, isdigit and islower also look seriously borken. /mast */ -#define WIDE_ISSPACE(C) (((C) < 256)?isspace(C):0) -#define WIDE_ISIDCHAR(C) (((C) < 256)?isidchar(C):1) -#define WIDE_ISALNUM(C) (((C) < 256)?isalnum(C):0) -#define WIDE_ISDIGIT(C) (((C) < 256)?isdigit(C):0) -#define WIDE_ISLOWER(C) (((C) < 256)?islower(C):0) - - #ifndef HAVE_GETTIMEOFDAY void GETTIMEOFDAY(struct timeval *t); #else diff --git a/src/stralloc.h b/src/stralloc.h index 2ddc9d7943..a920e69c6c 100644 --- a/src/stralloc.h +++ b/src/stralloc.h @@ -539,4 +539,14 @@ void low_f_sprintf(INT32 args, int compat_mode, struct string_builder *r); void init_sprintf(void); void exit_sprintf(void); +/* Warning, these run 'C' more than once */ +/* FIXME: Is it that great that every wide char is considered an + * identifier char? Doesn't strike me as very unicode compliant. + * isalnum, isdigit and islower also look seriously borken. /mast */ +#define WIDE_ISSPACE(C) (((C) < 256)?isspace(C):0) +#define WIDE_ISIDCHAR(C) (((C) < 256)?isidchar(C):1) +#define WIDE_ISALNUM(C) (((C) < 256)?isalnum(C):0) +#define WIDE_ISDIGIT(C) (((C) < 256)?isdigit(C):0) +#define WIDE_ISLOWER(C) (((C) < 256)?islower(C):0) + #endif /* STRALLOC_H */ -- GitLab