COMMON: Add a space between a string literal and a macro parameter so C++11 does not think the latter is a string literal suffix.

This commit is contained in:
Christoph Mallon 2012-03-15 10:40:04 +01:00 committed by Johannes Schickel
parent 2b57ccfd5e
commit 991d5364be

View File

@ -277,12 +277,12 @@ void registerDefaults() {
// Use this for boolean options; this distinguishes between "-x" and "-X",
// 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)) { \
if (isLongCmd ? (!strcmp(s+2, longCmd) || !strcmp(s+2, "no-" longCmd)) : (tolower(s[1]) == shortCmd)) { \
bool boolValue = (Common::isLower(s[1]) != 0); \
s += 2; \
if (isLongCmd) { \
boolValue = !strcmp(s, longCmd); \
s += boolValue ? (sizeof(longCmd) - 1) : (sizeof("no-"longCmd) - 1); \
s += boolValue ? (sizeof(longCmd) - 1) : (sizeof("no-" longCmd) - 1); \
} \
if (*s != '\0') goto unknownOption; \
const char *option = boolValue ? "true" : "false"; \