[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gettext documentation patch for Solaris 8 without NLS
From: |
Bruno Haible |
Subject: |
Re: gettext documentation patch for Solaris 8 without NLS |
Date: |
Fri, 10 May 2002 13:30:19 +0200 (CEST) |
Paul Eggert writes:
> It's probably worth warning about this in the GNU
> gettext manual. Here's a proposed patch for GNU gettext.
Better than to warn about the problem is to fix it. I'll be using the
appended patch.
> > % ./configure --disable-nls
> > % gmake
> > gcc -DHAVE_CONFIG_H -I. I./intl ... -c `test -f array.c || echo './'`array.c
> > In file included from /usr/include/locale.h:51,
> > from awk.h:63,
> > from array.c:40:
> > /usr/include/libintl.h:31: parse error before `char'
> > ...
> >
> > Solaris 8's <locale.h> includes <libintl.h>. We need to put #include
> > <locale.h> in awk.h immediately before the gettext.h block. This will
> > declare the functions first; our defines will override them if
> > appropriate.
Thanks for the report. This patch fixes it.
Bruno
diff -c -3 -r1.2 gettext.h
*** gettext.h 15 Jan 2002 13:00:48 -0000 1.2
--- gettext.h 10 May 2002 11:23:52 -0000
***************
*** 27,32 ****
--- 27,42 ----
#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.