[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gettext-0.14.1 -- problems compiling C++ programs
From: |
Bruno Haible |
Subject: |
Re: gettext-0.14.1 -- problems compiling C++ programs |
Date: |
Tue, 23 Nov 2004 18:54:58 +0100 |
User-agent: |
KMail/1.5 |
Peter Breitenlohner wrote:
> It is, however, g++ 3.3 or newer, but never mind that.
Ah, thanks. Find attached an updated fix.
> I am not entirely sure if the above suffices. At some time I needed to
> undefine gettext etc. in order not to get lots of "macro redefined"
> warnings.
This was fixed in glibc on 2004-07-21.
Bruno
*** gettext.h 13 Feb 2003 21:21:41 -0000 1.1
--- gettext.h 23 Nov 2004 17:53:09 -0000 1.3
***************
*** 1,5 ****
/* Convenience header for conditional use of GNU <libintl.h>.
! Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
--- 1,5 ----
/* Convenience header for conditional use of GNU <libintl.h>.
! Copyright (C) 1995-1998, 2000-2002, 2004 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
***************
*** 37,42 ****
--- 37,52 ----
# 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.