1*a7c91847Schristos /* Convenience header for conditional use of GNU <libintl.h>. 2*a7c91847Schristos Copyright (C) 1995-1998, 2000-2002, 2004 Free Software Foundation, Inc. 3*a7c91847Schristos 4*a7c91847Schristos This program is free software; you can redistribute it and/or modify 5*a7c91847Schristos it under the terms of the GNU General Public License as published by 6*a7c91847Schristos the Free Software Foundation; either version 2, or (at your option) 7*a7c91847Schristos any later version. 8*a7c91847Schristos 9*a7c91847Schristos This program is distributed in the hope that it will be useful, 10*a7c91847Schristos but WITHOUT ANY WARRANTY; without even the implied warranty of 11*a7c91847Schristos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12*a7c91847Schristos GNU General Public License for more details. 13*a7c91847Schristos 14*a7c91847Schristos You should have received a copy of the GNU General Public License along 15*a7c91847Schristos with this program; if not, write to the Free Software Foundation, 16*a7c91847Schristos Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ 17*a7c91847Schristos 18*a7c91847Schristos #ifndef _LIBGETTEXT_H 19*a7c91847Schristos #define _LIBGETTEXT_H 1 20*a7c91847Schristos 21*a7c91847Schristos /* NLS can be disabled through the configure --disable-nls option. */ 22*a7c91847Schristos #if ENABLE_NLS 23*a7c91847Schristos 24*a7c91847Schristos /* Get declarations of GNU message catalog functions. */ 25*a7c91847Schristos # include <libintl.h> 26*a7c91847Schristos 27*a7c91847Schristos #else 28*a7c91847Schristos 29*a7c91847Schristos /* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which 30*a7c91847Schristos chokes if dcgettext is defined as a macro. So include it now, to make 31*a7c91847Schristos later inclusions of <locale.h> a NOP. We don't include <libintl.h> 32*a7c91847Schristos as well because people using "gettext.h" will not include <libintl.h>, 33*a7c91847Schristos and also including <libintl.h> would fail on SunOS 4, whereas <locale.h> 34*a7c91847Schristos is OK. */ 35*a7c91847Schristos #if defined(__sun) 36*a7c91847Schristos # include <locale.h> 37*a7c91847Schristos #endif 38*a7c91847Schristos 39*a7c91847Schristos /* Many header files from the libstdc++ coming with g++ 3.3 or newer include 40*a7c91847Schristos <libintl.h>, which chokes if dcgettext is defined as a macro. So include 41*a7c91847Schristos it now, to make later inclusions of <libintl.h> a NOP. */ 42*a7c91847Schristos #if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3) 43*a7c91847Schristos # include <cstdlib> 44*a7c91847Schristos # if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H 45*a7c91847Schristos # include <libintl.h> 46*a7c91847Schristos # endif 47*a7c91847Schristos #endif 48*a7c91847Schristos 49*a7c91847Schristos /* Disabled NLS. 50*a7c91847Schristos The casts to 'const char *' serve the purpose of producing warnings 51*a7c91847Schristos for invalid uses of the value returned from these functions. 52*a7c91847Schristos On pre-ANSI systems without 'const', the config.h file is supposed to 53*a7c91847Schristos contain "#define const". */ 54*a7c91847Schristos # define gettext(Msgid) ((const char *) (Msgid)) 55*a7c91847Schristos # define dgettext(Domainname, Msgid) ((const char *) (Msgid)) 56*a7c91847Schristos # define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid)) 57*a7c91847Schristos # define ngettext(Msgid1, Msgid2, N) \ 58*a7c91847Schristos ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) 59*a7c91847Schristos # define dngettext(Domainname, Msgid1, Msgid2, N) \ 60*a7c91847Schristos ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) 61*a7c91847Schristos # define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ 62*a7c91847Schristos ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) 63*a7c91847Schristos # define textdomain(Domainname) ((const char *) (Domainname)) 64*a7c91847Schristos # define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname)) 65*a7c91847Schristos # define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset)) 66*a7c91847Schristos 67*a7c91847Schristos #endif 68*a7c91847Schristos 69*a7c91847Schristos /* A pseudo function call that serves as a marker for the automated 70*a7c91847Schristos extraction of messages, but does not call gettext(). The run-time 71*a7c91847Schristos translation is done at a different place in the code. 72*a7c91847Schristos The argument, String, should be a literal string. Concatenated strings 73*a7c91847Schristos and other string expressions won't work. 74*a7c91847Schristos The macro's expansion is not parenthesized, so that it is suitable as 75*a7c91847Schristos initializer for static 'char[]' or 'const char[]' variables. */ 76*a7c91847Schristos #define gettext_noop(String) String 77*a7c91847Schristos 78*a7c91847Schristos #endif /* _LIBGETTEXT_H */ 79