Skip to content

Commit

Permalink
build: fix ENABLE_NLS preprocessor check.
Browse files Browse the repository at this point in the history
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
661d603.
  • Loading branch information
Explorer09 authored and westes committed Nov 28, 2017
1 parent 11b7512 commit ea1faa2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/flexdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@
#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 */
Expand Down
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, "");
Expand Down

0 comments on commit ea1faa2

Please sign in to comment.