From ea1faa2d09693cf7f3a3c3c79a5ddb7fbd0d3ba5 Mon Sep 17 00:00:00 2001 From: Explorer09 Date: Sun, 5 Nov 2017 00:10:03 +0800 Subject: [PATCH] build: fix ENABLE_NLS preprocessor check. 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 | 6 ++++-- src/main.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/flexdef.h b/src/flexdef.h index b4981c4..a48c64d 100644 --- a/src/flexdef.h +++ b/src/flexdef.h @@ -76,8 +76,10 @@ #include #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 #endif /* HAVE_LOCALE_H */ diff --git a/src/main.c b/src/main.c index 65285a0..a4047d7 100644 --- a/src/main.c +++ b/src/main.c @@ -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, ""); -- 2.50.1