ALL: Avoid using is* macros from ctype.h

On some systems, passing signed chars to macros like isspace() etc. lead
to a runtime error. Hence, mark these macros as forbidden by default,
and introduce otherwise equivalent alternatives for them.
This commit is contained in:
Max Horn
2012-02-15 16:51:37 +01:00
parent 37e5b209a7
commit 658080deed
41 changed files with 183 additions and 105 deletions
+1 -1
View File
@@ -277,7 +277,7 @@ void registerDefaults() {
// resp. between "--some-option" and "--no-some-option".
#define DO_OPTION_BOOL(shortCmd, longCmd) \
if (isLongCmd ? (!strcmp(s+2, longCmd) || !strcmp(s+2, "no-"longCmd)) : (tolower(s[1]) == shortCmd)) { \
bool boolValue = (islower(static_cast<unsigned char>(s[1])) != 0); \
bool boolValue = (isLower(s[1]) != 0); \
s += 2; \
if (isLongCmd) { \
boolValue = !strcmp(s, longCmd); \