]> granicus.if.org Git - flex/commitdiff
build: fix ENABLE_NLS preprocessor check.
authorExplorer09 <explorer09@gmail.com>
Sat, 4 Nov 2017 16:10:03 +0000 (00:10 +0800)
committerWill Estes <westes575@gmail.com>
Tue, 28 Nov 2017 19:09:04 +0000 (14:09 -0500)
Because ENABLE_NLS may be defined to 0 (manually, not through
autoconf) and it's semantically incorrect to only check whether it's
defined.

This is a correction to commit
661d603b65385f62f372acd2017e5af2e0f0cd50.

src/flexdef.h
src/main.c

index b4981c46c94be759afd88777657875d8599da00b..a48c64d1eec1097a01cea9eef7a772a0e5423a0a 100644 (file)
 #include <strings.h>
 #include "flexint.h"
 
-/* We use gettext. So, when we write strings which should be translated, we mark them with _() */
-#ifdef ENABLE_NLS
+/* We use gettext. So, when we write strings which should be translated, we
+ * mark them with _()
+ */
+#if defined(ENABLE_NLS) && ENABLE_NLS
 #ifdef HAVE_LOCALE_H
 #include <locale.h>
 #endif /* HAVE_LOCALE_H */
index 65285a02685cd0110549132a9986e2cf8378a4cb..a4047d7be1011024fd90b40d88371f3c96faf3f9 100644 (file)
@@ -197,7 +197,7 @@ int flex_main (int argc, char *argv[])
 /* Wrapper around flex_main, so flex_main can be built as a library. */
 int main (int argc, char *argv[])
 {
-#ifdef ENABLE_NLS
+#if defined(ENABLE_NLS) && ENABLE_NLS
 #if HAVE_LOCALE_H
        setlocale (LC_MESSAGES, "");
         setlocale (LC_CTYPE, "");