diff options
author | Bruno Haible <bruno@clisp.org> | 2005-07-27 11:27:54 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2009-06-23 12:12:42 +0200 |
commit | 0ef9ec26435a02b72c97346e0d35580de048c8e0 (patch) | |
tree | a343c88e06f4b2e80e17d5d6c70262e0e3836dbf /gettext-runtime/intl | |
parent | 3236af7163ddf0dda162f0d99f120a9eb9382540 (diff) | |
download | external_gettext-0ef9ec26435a02b72c97346e0d35580de048c8e0.zip external_gettext-0ef9ec26435a02b72c97346e0d35580de048c8e0.tar.gz external_gettext-0ef9ec26435a02b72c97346e0d35580de048c8e0.tar.bz2 |
Tidy up exported symbols of libintl library.
Diffstat (limited to 'gettext-runtime/intl')
-rw-r--r-- | gettext-runtime/intl/ChangeLog | 24 | ||||
-rw-r--r-- | gettext-runtime/intl/Makefile.in | 23 | ||||
-rw-r--r-- | gettext-runtime/intl/bindtextdom.c | 2 | ||||
-rw-r--r-- | gettext-runtime/intl/gettextP.h | 78 | ||||
-rw-r--r-- | gettext-runtime/intl/loadinfo.h | 7 | ||||
-rw-r--r-- | gettext-runtime/intl/relocatable.h | 6 | ||||
-rw-r--r-- | gettext-runtime/intl/textdomain.c | 2 |
7 files changed, 92 insertions, 50 deletions
diff --git a/gettext-runtime/intl/ChangeLog b/gettext-runtime/intl/ChangeLog index 78a2365..2fe4cc7 100644 --- a/gettext-runtime/intl/ChangeLog +++ b/gettext-runtime/intl/ChangeLog @@ -1,3 +1,27 @@ +2005-07-24 Bruno Haible <bruno@clisp.org> + + Tidy up exported symbols. + * export.h: New file. + * gettextP.h: Move declarations so that libgnuintl.h is included + before loadinfo.h. Needed because libgnuintl.h defines + LIBINTL_DLL_EXPORTED and loadinfo.h uses it. + (_nl_msg_cat_cntr): Export. + * loadinfo.h (LIBINTL_DLL_EXPORTED): Provide fallback declaration. + (_nl_expand_alias): Export. + * bindtextdom.c: Include gettextP.h before libgnuintl.h. Needed so + that _INTL_REDIRECT_MACROS is defined when libgnuintl.h is included. + Otherwise libgnuintl.h may choose to use _INTL_REDIRECT_ASM, and then + gcc-4.0 ignores visibility declarations. + * textdomain.c: Likewise. + * relocatable.h (RELOCATABLE_DLL_EXPORTED) [HAVE_VISIBILITY]: Define + to the gcc visibility attribute. + * Makefile.in (DEFS): Define also BUILDING_LIBINTL and BUILDING_DLL. + (CFLAGS): Add CFLAG_VISIBILITY. + (DISTFILES.common): Add export.h. + (libgnuintl.h): Add LIBINTL_DLL_EXPORTED definition and uses. + (libintl.h): Create directly from libgnuintl.h.in, without + LIBINTL_DLL_EXPORTED. + 2005-07-21 Bruno Haible <bruno@clisp.org> * plural.y: Modify comment about #pragma alloca. diff --git a/gettext-runtime/intl/Makefile.in b/gettext-runtime/intl/Makefile.in index 23266c0..ca99d48 100644 --- a/gettext-runtime/intl/Makefile.in +++ b/gettext-runtime/intl/Makefile.in @@ -52,14 +52,16 @@ RANLIB = @RANLIB@ YACC = @INTLBISON@ -y -d YFLAGS = --name-prefix=__gettext +# -DBUILDING_LIBINTL: Change expansion of LIBINTL_DLL_EXPORTED macro. +# -DBUILDING_DLL: Change expansion of RELOCATABLE_DLL_EXPORTED macro. DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \ --DLIBDIR=\"$(libdir)\" -DIN_LIBINTL \ +-DLIBDIR=\"$(libdir)\" -DBUILDING_LIBINTL -DBUILDING_DLL -DIN_LIBINTL \ -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"$(libdir)\" -DNO_XMALLOC \ -Dset_relocation_prefix=libintl_set_relocation_prefix \ -Drelocate=libintl_relocate \ -DDEPENDS_ON_LIBICONV=1 @DEFS@ CPPFLAGS = @CPPFLAGS@ -CFLAGS = @CFLAGS@ +CFLAGS = @CFLAGS@ @CFLAG_VISIBILITY@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ @@ -137,7 +139,8 @@ OBJECTS = \ osdep.$lo \ intl-compat.$lo DISTFILES.common = Makefile.in \ -config.charset locale.alias ref-add.sin ref-del.sin $(HEADERS) $(SOURCES) +config.charset locale.alias ref-add.sin ref-del.sin export.h \ +$(HEADERS) $(SOURCES) DISTFILES.generated = plural.c DISTFILES.normal = VERSION DISTFILES.gettext = COPYING.LIB-2.0 COPYING.LIB-2.1 libintl.glibc \ @@ -251,10 +254,18 @@ libgnuintl.h: $(srcdir)/libgnuintl.h.in -e 's,@''HAVE_ASPRINTF''@,@HAVE_ASPRINTF@,g' \ -e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \ -e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \ - < $(srcdir)/libgnuintl.h.in > libgnuintl.h + < $(srcdir)/libgnuintl.h.in \ + | sed -e 's/extern \([^"]\)/extern LIBINTL_DLL_EXPORTED \1/' \ + -e "/#define _LIBINTL_H/r $(srcdir)/export.h" \ + | sed -e 's,@''HAVE_VISIBILITY''@,@HAVE_VISIBILITY@,g' \ + > libgnuintl.h -libintl.h: libgnuintl.h - cp libgnuintl.h libintl.h +libintl.h: $(srcdir)/libgnuintl.h.in + sed -e 's,@''HAVE_POSIX_PRINTF''@,@HAVE_POSIX_PRINTF@,g' \ + -e 's,@''HAVE_ASPRINTF''@,@HAVE_ASPRINTF@,g' \ + -e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \ + -e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \ + < $(srcdir)/libgnuintl.h.in > libintl.h charset.alias: $(srcdir)/config.charset $(SHELL) $(srcdir)/config.charset '@host@' > t-$@ diff --git a/gettext-runtime/intl/bindtextdom.c b/gettext-runtime/intl/bindtextdom.c index 069ac6e..405bdad 100644 --- a/gettext-runtime/intl/bindtextdom.c +++ b/gettext-runtime/intl/bindtextdom.c @@ -24,12 +24,12 @@ #include <stdlib.h> #include <string.h> +#include "gettextP.h" #ifdef _LIBC # include <libintl.h> #else # include "libgnuintl.h" #endif -#include "gettextP.h" /* Handle multi-threaded applications. */ #ifdef _LIBC diff --git a/gettext-runtime/intl/gettextP.h b/gettext-runtime/intl/gettextP.h index d2c97ba..134b8d8 100644 --- a/gettext-runtime/intl/gettextP.h +++ b/gettext-runtime/intl/gettextP.h @@ -30,6 +30,44 @@ # endif #endif +#ifdef _LIBC +extern char *__gettext (const char *__msgid); +extern char *__dgettext (const char *__domainname, const char *__msgid); +extern char *__dcgettext (const char *__domainname, const char *__msgid, + int __category); +extern char *__ngettext (const char *__msgid1, const char *__msgid2, + unsigned long int __n); +extern char *__dngettext (const char *__domainname, + const char *__msgid1, const char *__msgid2, + unsigned long int n); +extern char *__dcngettext (const char *__domainname, + const char *__msgid1, const char *__msgid2, + unsigned long int __n, int __category); +extern char *__dcigettext (const char *__domainname, + const char *__msgid1, const char *__msgid2, + int __plural, unsigned long int __n, + int __category); +extern char *__textdomain (const char *__domainname); +extern char *__bindtextdomain (const char *__domainname, + const char *__dirname); +extern char *__bind_textdomain_codeset (const char *__domainname, + const char *__codeset); +extern void _nl_finddomain_subfreeres (void) attribute_hidden; +extern void _nl_unload_domain (struct loaded_domain *__domain) + internal_function attribute_hidden; +#else +/* Declare the exported libintl_* functions, in a way that allows us to + call them under their real name. */ +# undef _INTL_REDIRECT_INLINE +# undef _INTL_REDIRECT_MACROS +# define _INTL_REDIRECT_MACROS +# include "libgnuintl.h" +extern char *libintl_dcigettext (const char *__domainname, + const char *__msgid1, const char *__msgid2, + int __plural, unsigned long int __n, + int __category); +#endif + #include "loadinfo.h" #include "gmo.h" /* Get nls_uint32. */ @@ -161,7 +199,7 @@ struct binding /* A counter which is incremented each time some previous translations become invalid. This variable is part of the external ABI of the GNU libintl. */ -extern int _nl_msg_cat_cntr; +extern LIBINTL_DLL_EXPORTED int _nl_msg_cat_cntr; #ifndef _LIBC const char *_nl_language_preferences_default (void); @@ -183,44 +221,6 @@ char *_nl_find_msg (struct loaded_l10nfile *domain_file, int convert, size_t *lengthp) internal_function; -#ifdef _LIBC -extern char *__gettext (const char *__msgid); -extern char *__dgettext (const char *__domainname, const char *__msgid); -extern char *__dcgettext (const char *__domainname, const char *__msgid, - int __category); -extern char *__ngettext (const char *__msgid1, const char *__msgid2, - unsigned long int __n); -extern char *__dngettext (const char *__domainname, - const char *__msgid1, const char *__msgid2, - unsigned long int n); -extern char *__dcngettext (const char *__domainname, - const char *__msgid1, const char *__msgid2, - unsigned long int __n, int __category); -extern char *__dcigettext (const char *__domainname, - const char *__msgid1, const char *__msgid2, - int __plural, unsigned long int __n, - int __category); -extern char *__textdomain (const char *__domainname); -extern char *__bindtextdomain (const char *__domainname, - const char *__dirname); -extern char *__bind_textdomain_codeset (const char *__domainname, - const char *__codeset); -extern void _nl_finddomain_subfreeres (void) attribute_hidden; -extern void _nl_unload_domain (struct loaded_domain *__domain) - internal_function attribute_hidden; -#else -/* Declare the exported libintl_* functions, in a way that allows us to - call them under their real name. */ -# undef _INTL_REDIRECT_INLINE -# undef _INTL_REDIRECT_MACROS -# define _INTL_REDIRECT_MACROS -# include "libgnuintl.h" -extern char *libintl_dcigettext (const char *__domainname, - const char *__msgid1, const char *__msgid2, - int __plural, unsigned long int __n, - int __category); -#endif - /* @@ begin of epilog @@ */ #endif /* gettextP.h */ diff --git a/gettext-runtime/intl/loadinfo.h b/gettext-runtime/intl/loadinfo.h index d672255..6e4b0c8 100644 --- a/gettext-runtime/intl/loadinfo.h +++ b/gettext-runtime/intl/loadinfo.h @@ -36,6 +36,10 @@ # define internal_function #endif +#ifndef LIBINTL_DLL_EXPORTED +# define LIBINTL_DLL_EXPORTED +#endif + /* Tell the compiler when a conditional or integer expression is almost always true or almost always false. */ #ifndef HAVE_BUILTIN_EXPECT @@ -110,7 +114,8 @@ _nl_make_l10nflist (struct loaded_l10nfile **l10nfile_list, /* Lookup the real locale name for a locale alias NAME, or NULL if NAME is not a locale alias (but possibly a real locale name). The return value is statically allocated and must not be freed. */ -extern const char *_nl_expand_alias (const char *name); +/* Part of the libintl ABI only for the sake of the gettext.m4 macro. */ +extern LIBINTL_DLL_EXPORTED const char *_nl_expand_alias (const char *name); /* Split a locale name NAME into its pieces: language, modifier, territory, codeset, special, sponsor, revision. diff --git a/gettext-runtime/intl/relocatable.h b/gettext-runtime/intl/relocatable.h index 614e64e..f6d3832 100644 --- a/gettext-runtime/intl/relocatable.h +++ b/gettext-runtime/intl/relocatable.h @@ -1,5 +1,5 @@ /* Provide relocatable packages. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 2005 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2003. This program is free software; you can redistribute it and/or modify it @@ -31,7 +31,9 @@ extern "C" { /* When building a DLL, we must export some functions. Note that because this is a private .h file, we don't need to use __declspec(dllimport) in any case. */ -#if defined _MSC_VER && BUILDING_DLL +#if HAVE_VISIBILITY && BUILDING_DLL +# define RELOCATABLE_DLL_EXPORTED __attribute__((__visibility__("default"))) +#elif defined _MSC_VER && BUILDING_DLL # define RELOCATABLE_DLL_EXPORTED __declspec(dllexport) #else # define RELOCATABLE_DLL_EXPORTED diff --git a/gettext-runtime/intl/textdomain.c b/gettext-runtime/intl/textdomain.c index 6f50edf..23e91c8 100644 --- a/gettext-runtime/intl/textdomain.c +++ b/gettext-runtime/intl/textdomain.c @@ -23,12 +23,12 @@ #include <stdlib.h> #include <string.h> +#include "gettextP.h" #ifdef _LIBC # include <libintl.h> #else # include "libgnuintl.h" #endif -#include "gettextP.h" /* Handle multi-threaded applications. */ #ifdef _LIBC |