]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Fix a build failure (-Wundef -Werror) when ENABLE_NLS is not defined,
authorGrégoire Sutre <gregoire.sutre@gmail.com>
Sat, 27 Mar 2010 11:19:32 +0000 (12:19 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 27 Mar 2010 11:19:32 +0000 (12:19 +0100)
which is the case with --disabled-nls.

* include/grub/i18n.h: Use (defined(ENABLE_NLS)
&& ENABLE_NLS) instead of ENABLE_NLS in all #if preprocessor macros.
* util/misc.c: Likewise.
* util/mkisofs/mkisofs.c: Likewise.
* util/mkisofs/mkisofs.h: Likewise.

ChangeLog
include/grub/i18n.h
util/misc.c
util/mkisofs/mkisofs.c
util/mkisofs/mkisofs.h

index 91b3069e0c096c3a6526292dd187c3bf29b7f7aa..ef534fd3116e005fee89722ea72cfb80fea3e0a0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2010-03-27  Grégoire Sutre  <gregoire.sutre@gmail.com>
+
+       Fix a build failure (-Wundef -Werror) when ENABLE_NLS is not defined,
+       which is the case with --disabled-nls.
+
+       * include/grub/i18n.h: Use (defined(ENABLE_NLS)
+       && ENABLE_NLS) instead of ENABLE_NLS in all #if preprocessor macros.
+       * util/misc.c: Likewise.
+       * util/mkisofs/mkisofs.c: Likewise.
+       * util/mkisofs/mkisofs.h: Likewise.
+
 2010-03-27  Vladimir Serbinenko  <phcoder@gmail.com>
 
        Simplify Apple CC support.
index 0cba547657bfa42a03ea5813855b5f39da89da8e..9e7f52d45e422dd01f6f34c107c646272c0074c5 100644 (file)
@@ -25,7 +25,7 @@
 extern const char *(*EXPORT_VAR(grub_gettext)) (const char *s);
 
 /* NLS can be disabled through the configure --disable-nls option.  */
-#if ENABLE_NLS
+#if (defined(ENABLE_NLS) && ENABLE_NLS)
 
 # ifdef GRUB_UTIL
 
@@ -34,7 +34,7 @@ extern const char *(*EXPORT_VAR(grub_gettext)) (const char *s);
 
 # endif /* GRUB_UTIL */
 
-#else /* ! ENABLE_NLS */
+#else /* ! (defined(ENABLE_NLS) && ENABLE_NLS) */
 
 /* Disabled NLS.
    The casts to 'const char *' serve the purpose of producing warnings
@@ -47,7 +47,7 @@ extern const char *(*EXPORT_VAR(grub_gettext)) (const char *s);
 #  define grub_gettext(str) ((const char *) (str))
 # endif /* GRUB_UTIL */
 
-#endif /* ENABLE_NLS */
+#endif /* (defined(ENABLE_NLS) && ENABLE_NLS) */
 
 #ifdef GRUB_UTIL
 # define _(str) gettext(str)
index 7381c8fdde9433db0313ba3e0424a243ab0541a5..0f52c218d1e87baa5d2c82206fa7074f089efc25 100644 (file)
@@ -604,10 +604,10 @@ make_system_path_relative_to_its_root (const char *path)
 void
 grub_util_init_nls (void)
 {
-#if ENABLE_NLS
+#if (defined(ENABLE_NLS) && ENABLE_NLS)
   setlocale (LC_ALL, "");
   bindtextdomain (PACKAGE, LOCALEDIR);
   textdomain (PACKAGE);
-#endif /* ENABLE_NLS */
+#endif /* (defined(ENABLE_NLS) && ENABLE_NLS) */
 }
 #endif
index 69b4b3d0d8253729b4a9749dfffd1cba910d39fa..16e2f0c7dbd37a4fd56dfbeb20f959da02c8caba 100644 (file)
@@ -640,11 +640,11 @@ int FDECL2(main, int, argc, char **, argv){
   char *log_file = 0;
 
   set_program_name (argv[0]);
-#if ENABLE_NLS
+#if (defined(ENABLE_NLS) && ENABLE_NLS)
   setlocale (LC_ALL, "");
   bindtextdomain (PACKAGE, LOCALEDIR);
   textdomain (PACKAGE);
-#endif /* ENABLE_NLS */
+#endif /* (defined(ENABLE_NLS) && ENABLE_NLS) */
 
   if (argc < 2)
     usage();
index 482db6ceb41e60a49a884b5d0699f0fa6caa440a..b699516e9ebb865114b6b783dff8f39c611244f5 100644 (file)
 #include <prototyp.h>
 #include <sys/stat.h>
 
-#if ENABLE_NLS
+#if (defined(ENABLE_NLS) && ENABLE_NLS)
 
 #  include <locale.h>
 #  include <libintl.h>
 
-#else /* ! ENABLE_NLS */
+#else /* ! (defined(ENABLE_NLS) && ENABLE_NLS) */
 
 /* Disabled NLS.
    The casts to 'const char *' serve the purpose of producing warnings
@@ -43,7 +43,7 @@
    On pre-ANSI systems without 'const', the config.h file is supposed to
    contain "#define const".  */
 #  define gettext(Msgid) ((const char *) (Msgid))
-#endif /* ENABLE_NLS */
+#endif /* (defined(ENABLE_NLS) && ENABLE_NLS) */
 
 #define _(str) gettext(str)
 #define N_(str) str