bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gettext documentation patch for Solaris 8 without NLS


From: Paul Eggert
Subject: gettext documentation patch for Solaris 8 without NLS
Date: Thu, 9 May 2002 10:49:51 -0700 (PDT)

> From: Ayamura KIKUCHI <address@hidden>
> Subject: [gawk-3.1.1] awk.h patch for Solaris 8 without NLS
> Date: Fri, 10 May 2002 00:00:41 +0900
> 
> % uname -a
> SunOS host 5.8 Generic_108528-14 sun4u sparc SUNW,Ultra
> % gcc --version
> 2.95.3
> 
> % ./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.


Good catch; thanks.  It's probably worth warning about this in the GNU
gettext manual.  Here's a proposed patch for GNU gettext.


2002-05-09  Paul Eggert  <address@hidden>

        * doc/gettext.texi (lib/gettext.h): Warn that locale.h should
        be included before gettext.h if both are included.

===================================================================
RCS file: doc/gettext.texi,v
retrieving revision 0.11.2.0
retrieving revision 0.11.2.1
diff -pu -r0.11.2.0 -r0.11.2.1
--- doc/gettext.texi    2002/04/22 18:26:53     0.11.2.0
+++ doc/gettext.texi    2002/05/09 17:44:27     0.11.2.1
@@ -6275,6 +6275,16 @@ instead of
 #include <libintl.h>
 @end example
 
+Some @file{<locale.h>} implementations declare functions that
address@hidden defines as macros when internationalization is
+disabled, so if you include both files you should include the former
+before the latter.  For example:
+
address@hidden
+#include <locale.h>
+#include "gettext.h"
address@hidden example
+
 The location of @code{gettext.h} is usually in a directory containing
 auxiliary include files. In many GNU packages, there is a directory
 @file{lib/} containing helper functions; @file{gettext.h} fits there.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]