summaryrefslogtreecommitdiff
path: root/lib/gettext.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gettext.h')
-rw-r--r--lib/gettext.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/gettext.h b/lib/gettext.h
index 835732e01..a0606dde5 100644
--- a/lib/gettext.h
+++ b/lib/gettext.h
@@ -36,6 +36,16 @@
# include <locale.h>
#endif
+/* Many header files from the libstdc++ coming with g++ 3.3 or newer include
+ <libintl.h>, which chokes if dcgettext is defined as a macro. So include
+ it now, to make later inclusions of <libintl.h> a NOP. */
+#if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3)
+# include <cstdlib>
+# if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H
+# include <libintl.h>
+# endif
+#endif
+
/* Disabled NLS.
The casts to 'const char *' serve the purpose of producing warnings
for invalid uses of the value returned from these functions.