From febd0cea3a96442ca1083855775f54740be2cc4e Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 15 Sep 2023 23:06:11 +0200 Subject: [PATCH] intl: Fix list of exported symbols (regression 2021-06-19). Reported by and Christian Weisgerber in and . Analyzed by Christian Weisgerber and Tijl Coosemans . * gettext-runtime/intl/Makefile.am (AM_CPPFLAGS): Set BUILDING_DLL. * gettext-runtime/intl/intl-compat.c: Update comments. --- gettext-runtime/intl/Makefile.am | 4 +++- gettext-runtime/intl/intl-compat.c | 25 ++++++++++++++++--------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/gettext-runtime/intl/Makefile.am b/gettext-runtime/intl/Makefile.am index 76fe427d3..aee3bd5d3 100644 --- a/gettext-runtime/intl/Makefile.am +++ b/gettext-runtime/intl/Makefile.am @@ -32,10 +32,12 @@ MAINTAINERCLEANFILES = SUFFIXES = # -DBUILDING_LIBINTL: Change expansion of LIBINTL_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) \ - -DLIBDIR=\"$(libdir)\" -DBUILDING_LIBINTL + -DLIBDIR=\"$(libdir)\" -DBUILDING_LIBINTL -DBUILDING_DLL if WOE32 # On mingw, disable the declarations of *printf functions as aliases to the diff --git a/gettext-runtime/intl/intl-compat.c b/gettext-runtime/intl/intl-compat.c index d141e0453..a33dacb7e 100644 --- a/gettext-runtime/intl/intl-compat.c +++ b/gettext-runtime/intl/intl-compat.c @@ -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 @@ -23,15 +22,23 @@ /* @@ 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 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 '. + 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 include file. + */ #undef gettext #undef dgettext -- 2.47.3