aboutsummaryrefslogtreecommitdiffstats
path: root/gettext.h
diff options
context:
space:
mode:
Diffstat (limited to 'gettext.h')
-rw-r--r--gettext.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/gettext.h b/gettext.h
index 1ad714f4..f7f28f71 100644
--- a/gettext.h
+++ b/gettext.h
@@ -22,11 +22,26 @@
/* NLS can be disabled through the configure --disable-nls option. */
#if ENABLE_NLS
+/* ADR: Need this so gcc -g without -O works. */
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#endif /* HAVE_LOCALE_H */
+
/* Get declarations of GNU message catalog functions. */
# include <libintl.h>
#else
+/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which
+ chokes if dcgettext is defined as a macro. So include it now, to make
+ later inclusions of <locale.h> a NOP. We don't include <libintl.h>
+ as well because people using "gettext.h" will not include <libintl.h>,
+ and also including <libintl.h> would fail on SunOS 4, whereas <locale.h>
+ is OK. */
+#if defined(__sun)
+# include <locale.h>
+#endif
+
/* Disabled NLS.
The casts to 'const char *' serve the purpose of producing warnings
for invalid uses of the value returned from these functions.