Update.
authorUlrich Drepper <drepper@redhat.com>
Mon, 8 Apr 2002 08:59:00 +0000 (08:59 +0000)
committerUlrich Drepper <drepper@redhat.com>
Mon, 8 Apr 2002 08:59:00 +0000 (08:59 +0000)
2002-04-08  Ulrich Drepper  <drepper@redhat.com>

* Makeconfig (CPPFLAGS): Also add CPPFLAGS-<basename> where <basename>
is the name of the source file without extension.
* Makefile (distribute): Add cppflags-iterator.mk.
* cppflags-iterator.mk: New file.
* extra-lib.mk: For the sources of the library run
cppflags-iterator.mk.

* include/libintl.h: Declare __dcgettext_internal and
_libc_intl_domainname_internal.  Define __dcgettext using these
two symbols if used in libc itself.
* argp/argp-help.c: Define dgettext using __dcgettext_internal and
_libc_intl_domainname_internal.
* argp/argp-parse.c: Likewise.
* intl/dcgettext.c (__dcgettext): Use INTDEF to define alias.
* intl/dgettext.c: Call __dcgettext_internal instead of __dcgettext.
* intl/gettext.c: Likewise.
* locale/SYS_libc.c (_libc_intl_domainname): Use INTDEF to define
alias.
* posix/regcomp.c (gettext): Use __dcgettext_internal instead of
__dcgettext.
* posix/regex_internal.c (gettext): Likewise.

13 files changed:
ChangeLog
Makefile
argp/argp-help.c
argp/argp-parse.c
cppflags-iterator.mk [new file with mode: 0644]
extra-lib.mk
include/libintl.h
intl/dcgettext.c
intl/dgettext.c
intl/gettext.c
locale/SYS_libc.c
posix/regcomp.c
posix/regex_internal.c

index c93587555273f0f6702f3c5ad41bc0390a562e97..912c88ada6ea949795b8a159dc01bb3400d56689 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,27 @@
+2002-04-08  Ulrich Drepper  <drepper@redhat.com>
+
+       * Makeconfig (CPPFLAGS): Also add CPPFLAGS-<basename> where <basename>
+       is the name of the source file without extension.
+       * Makefile (distribute): Add cppflags-iterator.mk.
+       * cppflags-iterator.mk: New file.
+       * extra-lib.mk: For the sources of the library run
+       cppflags-iterator.mk.
+
+       * include/libintl.h: Declare __dcgettext_internal and
+       _libc_intl_domainname_internal.  Define __dcgettext using these
+       two symbols if used in libc itself.
+       * argp/argp-help.c: Define dgettext using __dcgettext_internal and
+       _libc_intl_domainname_internal.
+       * argp/argp-parse.c: Likewise.
+       * intl/dcgettext.c (__dcgettext): Use INTDEF to define alias.
+       * intl/dgettext.c: Call __dcgettext_internal instead of __dcgettext.
+       * intl/gettext.c: Likewise.
+       * locale/SYS_libc.c (_libc_intl_domainname): Use INTDEF to define
+       alias.
+       * posix/regcomp.c (gettext): Use __dcgettext_internal instead of
+       __dcgettext.
+       * posix/regex_internal.c (gettext): Likewise.
+
 2002-04-08  Andreas Jaeger  <aj@suse.de>
 
        * sysdeps/x86_64/fpu/s_llrint.S: New.
index eba8cad1dde26ddb0dc91dcaa6ada3f3c448b689..95adfc959eb8f505dfc26538b329f05f083f634d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -258,7 +258,7 @@ distribute  :=      README README.libm INSTALL FAQ FAQ.in NOTES NEWS BUGS   \
                rpm/template rpm/rpmrc glibcbug.in abi-tags stub-tag.h  \
                test-skeleton.c include/des.h include/libc-internal.h   \
                include/shlib-compat.h include/pthread.h Versions.def   \
-               INTERFACE CONFORMANCE NAMESPACE                         \
+               cppflags-iterator.mk INTERFACE CONFORMANCE NAMESPACE    \
                $(addprefix scripts/,                                   \
                            rellns-sh config.sub config.guess           \
                            mkinstalldirs move-if-change install-sh     \
index e51825c28b2db9be647132abb1cfe95286285338..af23d93fe27779cb24a6c9b47a40271ba6af7ce8 100644 (file)
@@ -1,5 +1,5 @@
 /* Hierarchial argument parsing help output
-   Copyright (C) 1995-2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1995-2000, 2001, 2002 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Miles Bader <miles@gnu.ai.mit.edu>.
 
@@ -62,7 +62,8 @@ char *alloca ();
 #  include <libintl.h>
 #  ifdef _LIBC
 #   undef dgettext
-#   define dgettext(domain, msgid) __dcgettext (domain, msgid, LC_MESSAGES)
+#   define dgettext(domain, msgid) \
+  INTUSE(__dcgettext) (domain, msgid, LC_MESSAGES)
 #  endif
 # else
 #  define dgettext(domain, msgid) (msgid)
index 5a5146fba3876ab7cd81a1ef84f3e2e784ad21e1..6d5f08cf83ccdf7e1f3f0a4c6ce7f9fa4347c614 100644 (file)
@@ -35,7 +35,8 @@
 #  include <libintl.h>
 #  ifdef _LIBC
 #   undef dgettext
-#   define dgettext(domain, msgid) __dcgettext (domain, msgid, LC_MESSAGES)
+#   define dgettext(domain, msgid) \
+  INTUSE(__dcgettext) (domain, msgid, LC_MESSAGES)
 #  endif
 # else
 #  define dgettext(domain, msgid) (msgid)
diff --git a/cppflags-iterator.mk b/cppflags-iterator.mk
new file mode 100644 (file)
index 0000000..0748885
--- /dev/null
@@ -0,0 +1,7 @@
+# This file is included several times in a row, once
+# for each element of $(lib)-routines and $(lib)-sysdeps_routines.
+
+cpp-src := $(firstword $(cpp-srcs-left))
+cpp-srcs-left := $(filter-out $(cpp-src),$(cpp-srcs-left))
+
+CPPFLAGS-$(cpp-src) = -DNOT_IN_LIBC -DIS_IN_$(lib)
index cdb48e2fff241c4fdcc2ff5de191dc48f34107d1..2a8227f3697a2bb786f49207adabaeb24c705a01 100644 (file)
@@ -78,3 +78,13 @@ $(objpfx)$(lib).so: $(firstword $($(lib)-map) \
 endif
 
 endif
+
+cpp-srcs-left = $(lib)-routines
+ifneq (,$($(lib)-routines))
+cpp-srcs-left = $($(lib)-routines)
+include $(patsubst %,$(..)cppflags-iterator.mk,$($(lib)-routines))
+endif
+ifneq (,$($(lib)-sysdep_routines))
+cpp-srcs-left = $($(lib)-sysdep_routines)
+include $(patsubst %,$(..)cppflags-iterator.mk,$($(lib)-sysdep_routines))
+endif
index dc54ccfc7b782aab23f4350eb848162e577304bb..a4d6148d8d269e75e2d3210b93ccbd3db1f70d79 100644 (file)
@@ -8,12 +8,16 @@ extern char *__dgettext (__const char *__domainname,
                         __const char *__msgid);
 extern char *__dcgettext (__const char *__domainname,
                          __const char *__msgid, int __category);
+extern char *__dcgettext_internal (__const char *__domainname,
+                                  __const char *__msgid, int __category)
+     attribute_hidden;
 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 const char _libc_intl_domainname[];
+extern const char _libc_intl_domainname_internal[] attribute_hidden;
 
 /* Define the macros `_' and `N_' for conveniently marking translatable
    strings in the libc source code.  We have to make sure we get the
@@ -24,6 +28,12 @@ extern const char _libc_intl_domainname[];
 
 # undef _
 /* This is defined as an optimizing macro, so use it.  */
-# define _(msgid) __dcgettext (_libc_intl_domainname, (msgid), LC_MESSAGES)
+# if !defined NOT_IN_LIBC && defined SHARED
+#  define _(msgid) \
+  __dcgettext_internal (_libc_intl_domainname_internal, (msgid), LC_MESSAGES)
+# else
+#  define _(msgid) \
+  __dcgettext (_libc_intl_domainname, (msgid), LC_MESSAGES)
+#endif
 
 #endif
index c250da42b32dd950e3c04f14dae5a0f374ba7040..feea12c0ba864bac4d0759d6c260acadf9345f03 100644 (file)
@@ -1,5 +1,5 @@
 /* Implementation of the dcgettext(3) function.
-   Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1995-1999, 2000, 2001, 2002 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -55,5 +55,6 @@ DCGETTEXT (domainname, msgid, category)
 
 #ifdef _LIBC
 /* Alias for function name in GNU C Library.  */
+INTDEF(__dcgettext)
 weak_alias (__dcgettext, dcgettext);
 #endif
index 02ca2b16877ec4b8091326e88b33cf82a89681ef..0fa9fc2e82a67b6e60c7455daac2677e71c709bb 100644 (file)
@@ -1,5 +1,5 @@
 /* Implementation of the dgettext(3) function.
-   Copyright (C) 1995-1997, 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1995-1997, 2000, 2001, 2002 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -38,7 +38,7 @@
    prefix.  So we have to make a difference here.  */
 #ifdef _LIBC
 # define DGETTEXT __dgettext
-# define DCGETTEXT __dcgettext
+# define DCGETTEXT INTUSE(__dcgettext)
 #else
 # define DGETTEXT dgettext__
 # define DCGETTEXT dcgettext__
index 1f992c8e77ba46159ff05a5f96dd65b292cdf244..ec5fa3a84abfae9ec3c8b74e2dd6c9447cebf9ad 100644 (file)
@@ -1,5 +1,5 @@
 /* Implementation of gettext(3) function.
-   Copyright (C) 1995, 1997, 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1997, 2000, 2001, 2002 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -43,7 +43,7 @@
    prefix.  So we have to make a difference here.  */
 #ifdef _LIBC
 # define GETTEXT __gettext
-# define DCGETTEXT __dcgettext
+# define DCGETTEXT INTUSE(__dcgettext)
 #else
 # define GETTEXT gettext__
 # define DCGETTEXT dcgettext__
index 53c9a6034ed5a59b14afa81470bac282040edd67..4f9e946cf3b2338ef1125a97509bac1463fdba5c 100644 (file)
@@ -2,3 +2,4 @@
    so the string constant is not repeated in dozens of object files.  */
 
 const char _libc_intl_domainname[] = "libc";
+INTDEF(_libc_intl_domainname)
index 7e3954fdad799a21fad474ed465cb4eed28ee671..b5f88005696812341f213fb35a71733ecd3f326d 100644 (file)
@@ -42,7 +42,8 @@
 # include <libintl.h>
 # ifdef _LIBC
 #  undef gettext
-#  define gettext(msgid) __dcgettext ("libc", msgid, LC_MESSAGES)
+#  define gettext(msgid) \
+  INTUSE(__dcgettext) (_libc_intl_domainname_internal, msgid, LC_MESSAGES)
 # endif
 #else
 # define gettext(msgid) (msgid)
index c2b0f9b4b026c23a09cd27200cade02032cf5d00..8b16dd6cef6222ff3c07219e619b2fa7e983f8f0 100644 (file)
@@ -41,7 +41,8 @@
 # include <libintl.h>
 # ifdef _LIBC
 #  undef gettext
-#  define gettext(msgid) __dcgettext ("libc", msgid, LC_MESSAGES)
+#  define gettext(msgid) \
+  INTUSE(__dcgettext) (_libc_intl_domainname_internal, msgid, LC_MESSAGES)
 # endif
 #else
 # define gettext(msgid) (msgid)