diff mbox

[bootstrap] Tentative fix for PR 54281

Message ID 502D4365.8010205@google.com
State New
Headers show

Commit Message

Diego Novillo Aug. 16, 2012, 7 p.m. UTC
On 12-08-16 14:46 , Joseph S. Myers wrote:
> On Thu, 16 Aug 2012, Diego Novillo wrote:
>
>> diff --git a/gcc/intl.h b/gcc/intl.h
>> index c4db354..745fefd 100644
>> --- a/gcc/intl.h
>> +++ b/gcc/intl.h
>> @@ -27,8 +27,8 @@
>>   # define setlocale(category, locale) (locale)
>>   #endif
>>
>> -#ifdef ENABLE_NLS
>>   #include <libintl.h>
>> +#ifdef ENABLE_NLS
>
> I'm not sure it's safe to assume libintl.h exists on all hosts (e.g.
> MinGW) unless ENABLE_NLS.  (If ENABLE_NLS, the intl/ directory will have
> built that header if the host didn't have it.)

I wonder if we couldn't simply '#define _LIBINTL_H 1' in the #else 
branch then.  Something like this (though it seems a bit hacky to me):
diff mbox

Patch

diff --git a/gcc/intl.h b/gcc/intl.h
index c4db354..3da4738 100644
--- a/gcc/intl.h
+++ b/gcc/intl.h
@@ -32,6 +32,9 @@ 
  extern void gcc_init_libintl (void);
  extern size_t gcc_gettext_width (const char *);
  #else
+/* Prevent libintl.h from being included, since we are truncating
+   some functions (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54281).  */
+# define _LIBINTL_H 1
  /* Stubs.  */
  # undef textdomain
  # define textdomain(domain) (domain)