]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
intl: Fix list of exported symbols (regression 2021-06-19).
authorBruno Haible <bruno@clisp.org>
Fri, 15 Sep 2023 21:06:11 +0000 (23:06 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 19 Sep 2023 20:12:05 +0000 (22:12 +0200)
Reported by <fxcoudert@gcc.gnu.org>
and Christian Weisgerber <naddy@mips.inka.de>
in <https://savannah.gnu.org/bugs/?64323>
and <https://lists.gnu.org/archive/html/bug-gettext/2023-07/msg00005.html>.
Analyzed by Christian Weisgerber <naddy@mips.inka.de> and
Tijl Coosemans <tijl@FreeBSD.org>.

* gettext-runtime/intl/Makefile.am (AM_CPPFLAGS): Set BUILDING_DLL.
* gettext-runtime/intl/intl-compat.c: Update comments.

gettext-runtime/intl/Makefile.am
gettext-runtime/intl/intl-compat.c

index 753e75e5fc9267f2c3ce9756f4165ce5c9997a09..2bed67b7506325784deb765f0c8afd744c561704 100644 (file)
@@ -32,10 +32,12 @@ SUFFIXES =
 
 # -DBUILDING_LIBINTL: Change expansion of LIBINTL_DLL_EXPORTED macro.
 # -DBUILDING_DLL: Change expansion of RELOCATABLE_DLL_EXPORTED macro.
+# -DBUILDING_DLL: Change expansion of DLL_EXPORTED macro. We're compiling
+#                 a library. Exporting the relevant symbols is desired.
 AM_CPPFLAGS = \
   -Ignulib-lib -I$(srcdir)/gnulib-lib \
   -DLOCALEDIR=$(localedir_c_make) -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \
-  -DLIBDIR=\"$(libdir)\" -DBUILDING_LIBINTL
+  -DLIBDIR=\"$(libdir)\" -DBUILDING_LIBINTL -DBUILDING_DLL
 
 if WOE32
 # On mingw, disable the declarations of *printf functions as aliases to the
index d141e0453a4936dcefab11a73f214f372a08f734..a33dacb7e65b13ff2a31c0da0fc581dd206ad3c8 100644 (file)
@@ -1,5 +1,4 @@
-/* intl-compat.c - Stub functions to call gettext functions from GNU gettext
-   Library.
+/* Redirections from public function names to GNU libintl functions.
    Copyright (C) 1995, 2000-2003, 2005, 2023 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
 
 /* @@ end of prolog @@ */
 
+
 /* 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.
-   It is also compiled into libgnuintl so that libgnuintl.so can be used
-   as LD_PRELOADable library on glibc systems, to provide the extra
-   features that the functions in the libc don't have (namely, logging).  */
-
+   It is compiled into libintl for three purposes:
+     * Packages that bind libintl into other programming languages
+       (Python, Perl, PHP, OCaml, Free Pascal Compiler, mailfromd's mail
+       filtering language, and many others) bind to the symbols without
+       prefix and at the linker level, i.e. without '#include <libintl.h>'.
+       Only few packages bind to the symbols with "libintl_" prefix.
+     * On glibc systems, we want that existing and future features of
+       GNU gettext (such as the logging to $GETTEXT_LOG_UNTRANSLATED)
+       become available when the program is linked against -lintl or
+       when libintl.so is used LD_PRELOADable library.
+     * 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
 #undef dgettext