diff options
Diffstat (limited to 'intl/intl-compat.c')
-rw-r--r-- | intl/intl-compat.c | 67 |
1 files changed, 16 insertions, 51 deletions
diff --git a/intl/intl-compat.c b/intl/intl-compat.c index 0a06ce94..da890159 100644 --- a/intl/intl-compat.c +++ b/intl/intl-compat.c @@ -1,6 +1,6 @@ /* intl-compat.c - Stub functions to call gettext functions from GNU gettext Library. - Copyright (C) 1995, 2000, 2001 Software Foundation, Inc. + Copyright (C) 1995, 2000-2002 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 @@ -21,52 +21,17 @@ # include <config.h> #endif +#define _INTL_REDIRECT_MACROS #include "libgnuintl.h" #include "gettextP.h" /* @@ end of prolog @@ */ -/* This file redirects the gettext functions (without prefix or suffix) to - those defined in the included GNU gettext library (with "__" suffix). - It is compiled into libintl when the included GNU gettext library is - configured --with-included-gettext. - - This redirection works also in the case that the system C library or - the system libintl library contain gettext/textdomain/... functions. - If it didn't, we would need to add preprocessor level redirections to - libgnuintl.h of the following form: - -# define gettext gettext__ -# define dgettext dgettext__ -# define dcgettext dcgettext__ -# define ngettext ngettext__ -# define dngettext dngettext__ -# define dcngettext dcngettext__ -# define textdomain textdomain__ -# define bindtextdomain bindtextdomain__ -# define bind_textdomain_codeset bind_textdomain_codeset__ - - How does this redirection work? There are two cases. - A. When libintl.a is linked into an executable, it works because - functions defined in the executable always override functions in - the shared libraries. - B. When libintl.so is used, it works because - 1. those systems defining gettext/textdomain/... in the C library - (namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer) are - ELF systems and define these symbols as weak, thus explicitly - letting other shared libraries override it. - 2. those systems defining gettext/textdomain/... in a standalone - libintl.so library (namely, Solaris 2.3 and newer) have this - shared library in /usr/lib, and the linker will search /usr/lib - *after* the directory where the GNU gettext library is installed. - - A third case, namely when libintl.a is linked into a shared library - whose name is not libintl.so, is not supported. In this case, on - Solaris, when -lintl precedes the linker option for the shared library - containing GNU gettext, the system's gettext would indeed override - the GNU gettext. Anyone doing this kind of stuff must be clever enough - to 1. compile libintl.a with -fPIC, 2. remove -lintl from his linker - command line. */ +/* This file redirects the gettext functions (without prefix) to those + defined in the included GNU libintl library (with "libintl_" prefix). + It is compiled into libintl in order to make the AM_GNU_GETTEXT test + of gettext <= 0.11.2 work with the libintl library >= 0.11.3 which + has the redirections primarily in the <libintl.h> include file. */ #undef gettext @@ -84,7 +49,7 @@ char * gettext (msgid) const char *msgid; { - return gettext__ (msgid); + return libintl_gettext (msgid); } @@ -93,7 +58,7 @@ dgettext (domainname, msgid) const char *domainname; const char *msgid; { - return dgettext__ (domainname, msgid); + return libintl_dgettext (domainname, msgid); } @@ -103,7 +68,7 @@ dcgettext (domainname, msgid, category) const char *msgid; int category; { - return dcgettext__ (domainname, msgid, category); + return libintl_dcgettext (domainname, msgid, category); } @@ -113,7 +78,7 @@ ngettext (msgid1, msgid2, n) const char *msgid2; unsigned long int n; { - return ngettext__ (msgid1, msgid2, n); + return libintl_ngettext (msgid1, msgid2, n); } @@ -124,7 +89,7 @@ dngettext (domainname, msgid1, msgid2, n) const char *msgid2; unsigned long int n; { - return dngettext__ (domainname, msgid1, msgid2, n); + return libintl_dngettext (domainname, msgid1, msgid2, n); } @@ -136,7 +101,7 @@ dcngettext (domainname, msgid1, msgid2, n, category) unsigned long int n; int category; { - return dcngettext__ (domainname, msgid1, msgid2, n, category); + return libintl_dcngettext (domainname, msgid1, msgid2, n, category); } @@ -144,7 +109,7 @@ char * textdomain (domainname) const char *domainname; { - return textdomain__ (domainname); + return libintl_textdomain (domainname); } @@ -153,7 +118,7 @@ bindtextdomain (domainname, dirname) const char *domainname; const char *dirname; { - return bindtextdomain__ (domainname, dirname); + return libintl_bindtextdomain (domainname, dirname); } @@ -162,5 +127,5 @@ bind_textdomain_codeset (domainname, codeset) const char *domainname; const char *codeset; { - return bind_textdomain_codeset__ (domainname, codeset); + return libintl_bind_textdomain_codeset (domainname, codeset); } |