diff options
author | Pedro Alves <palves@redhat.com> | 2016-09-19 16:55:35 +0100 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2016-09-19 16:55:35 +0100 |
commit | 6679754127e51d9c3bd0e387fabbe4e71038c8ce (patch) | |
tree | d9f56b6cb99f94ea0d8bcb276df68f6164aac2c0 /gdb/main.c | |
parent | b19753ce31da347605dfa903c6fd2158e2444f0d (diff) | |
download | gdb-6679754127e51d9c3bd0e387fabbe4e71038c8ce.zip gdb-6679754127e51d9c3bd0e387fabbe4e71038c8ce.tar.gz gdb-6679754127e51d9c3bd0e387fabbe4e71038c8ce.tar.bz2 |
gdb: Fix build breakage with GCC 4.1 and --disable-nls
Ref: https://sourceware.org/ml/gdb-patches/2016-09/msg00203.html
The std::{min,max} patch caused build failures when configuring GDB
with with --disable-nls and using GCC 4.1.
The reason is this bit in common/gdb_locale.h:
#ifdef ENABLE_NLS
...
#else
# define gettext(Msgid) (Msgid)
...
#endif
This causes problems if the <libintl.h> header is first included at
any point after "gdb_locale.h".
Specifically, the gettext&co declarations in libintl.h:
extern char *gettext (__const char *__msgid)
__THROW __attribute_format_arg__ (1);
end up broken after preprocessing:
extern char *(__const char *__msgid)
throw () __attribute__ ((__format_arg__ (1)));
After the std::min/std::max change to include <algorithm>, this now
happens with at least the GCC 4.1 copy of <algorithm>, which includes
<libintl.h> via <bits/stl_algobase.h>, <iosfwd>, and
<bits/c++locale.h>.
The fix is to simply remove the troublesome *gettext and *textdomain
macros, leaving only the _ and N_ ones.
gdb/ChangeLog:
2016-09-19 Pedro Alves <palves@redhat.com>
* common/gdb_locale.h [!ENABLE_NLS] (gettext, dgettext, dcgettext,
textdomain, bindtextdomain): Delete macros.
* main.c (captured_main) [!ENABLE_NLS]: Skip bintextdomain and
textdomain calls.
Diffstat (limited to 'gdb/main.c')
-rw-r--r-- | gdb/main.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -501,8 +501,10 @@ captured_main (void *data) #if defined (HAVE_SETLOCALE) setlocale (LC_CTYPE, ""); #endif +#ifdef ENABLE_NLS bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); +#endif bfd_init (); notice_open_fds (); |