about summary refs log tree commit diff
path: root/intl/dcigettext.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-12-11 22:59:29 +0000
committerRoland McGrath <roland@gnu.org>2002-12-11 22:59:29 +0000
commit0f1316460cae46817ae843d0bba15c259d77d0e6 (patch)
tree8c95e9bd3a241314fc28006101879fd5bb51fc24 /intl/dcigettext.c
parent5cb5cfa2a26007b9a4a1c89d791cb5a0493bf7cd (diff)
downloadglibc-0f1316460cae46817ae843d0bba15c259d77d0e6.tar.gz
glibc-0f1316460cae46817ae843d0bba15c259d77d0e6.tar.xz
glibc-0f1316460cae46817ae843d0bba15c259d77d0e6.zip
* intl/gettext.h: Renamed to ...
	* intl/gmo.h: ... here.
	* intl/Makefile (distribute): Add gmo.h, remove gettext.h.
	* intl/gettextP.h: Update.
	* intl/loadmsgcat.c: Update.

	* intl/gettextP.h (PARAMS): Make more portable.
	(attribute_hidden): Define as empty macro if not already defined.
	* intl/hash-string.h (PARAMS): Make more portable.
	* intl/loadinfo.h (PARAMS): Likewise.
	* intl/plural-exp.h (PARAMS): Likewise.
	(attribute_hidden): Move definition near the definition of
	internal_function.

	* intl/gettextP.h (_nl_locale_name) [!_LIBC]: New declaration.
	* intl/plural-exp.h (plural_eval) [!_LIBC]: New declaration.

2002-07-13  Bruno Haible  <bruno@clisp.org>

	* intl/dcigettext.c (freea): New macro.
	(FREE_BLOCKS): Free also the registered blocks.
	(DCIGETTEXT): Free the 'search' variable.
	Reported by Andreas Fischer <a.fischer@asentics.de>.

2002-04-27  Bruno Haible  <bruno@clisp.org>

	* intl/gettextP.h [! _LIBC]: Use prefix libintl_ instead of suffix __.
	* intl/dcigettext.c: Likewise.
	* intl/dcgettext.c: Likewise.
	* intl/dgettext.c: Likewise.
	* intl/gettext.c: Likewise.
	* intl/dcngettext.c: Likewise.
	* intl/dngettext.c: Likewise.
	* intl/ngettext.c: Likewise.
	* intl/textdomain.c: Likewise.
	* intl/bindtextdom.c: Likewise.
	* intl/plural-exp.h: Likewise.

2002-01-02  Bruno Haible  <bruno@clisp.org>

	* intl/loadmsgcat.c (_nl_init_domain_conv): Use PARAMS in extern decl.

2001-04-30  Bruno Haible  <bruno@clisp.org>

	* intl/dcigettext.c (getuid, getgid, geteuid, getegid): Provide
	default macro definitions.  Needed for mingw32.
Diffstat (limited to 'intl/dcigettext.c')
-rw-r--r--intl/dcigettext.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/intl/dcigettext.c b/intl/dcigettext.c
index 80c71efbc4..9118dbdda9 100644
--- a/intl/dcigettext.c
+++ b/intl/dcigettext.c
@@ -103,10 +103,10 @@ extern int errno;
    names than the internal variables in GNU libc, otherwise programs
    using libintl.a cannot be linked statically.  */
 #if !defined _LIBC
-# define _nl_default_default_domain _nl_default_default_domain__
-# define _nl_current_default_domain _nl_current_default_domain__
-# define _nl_default_dirname _nl_default_dirname__
-# define _nl_domain_bindings _nl_domain_bindings__
+# define _nl_default_default_domain libintl_nl_default_default_domain
+# define _nl_current_default_domain libintl_nl_current_default_domain
+# define _nl_default_dirname libintl_nl_default_dirname
+# define _nl_domain_bindings libintl_nl_domain_bindings
 #endif
 
 /* Some compilers, like SunOS4 cc, don't have offsetof in <stddef.h>.  */
@@ -280,6 +280,7 @@ static const char *category_to_name PARAMS ((int category)) internal_function;
    some additional code emulating it.  */
 #ifdef HAVE_ALLOCA
 /* Nothing has to be done.  */
+# define freea(p) /* nothing */
 # define ADD_BLOCK(list, address) /* nothing */
 # define FREE_BLOCKS(list) /* nothing */
 #else
@@ -304,11 +305,13 @@ struct block_list
     while (list != NULL) {						      \
       struct block_list *old = list;					      \
       list = list->next;						      \
+      free (old->address);						      \
       free (old);							      \
     }									      \
   } while (0)
 # undef alloca
 # define alloca(size) (malloc (size))
+# define freea(p) free (p)
 #endif	/* have alloca */
 
 
@@ -332,7 +335,7 @@ typedef unsigned char transmem_block_t;
 #ifdef _LIBC
 # define DCIGETTEXT __dcigettext
 #else
-# define DCIGETTEXT dcigettext__
+# define DCIGETTEXT libintl_dcigettext
 #endif
 
 /* Lock variable to protect the global data in the gettext implementation.  */
@@ -346,6 +349,18 @@ __libc_rwlock_define_initialized (, _nl_state_lock attribute_hidden)
 # define ENABLE_SECURE __libc_enable_secure
 # define DETERMINE_SECURE
 #else
+# ifndef HAVE_GETUID
+#  define getuid() 0
+# endif
+# ifndef HAVE_GETGID
+#  define getgid() 0
+# endif
+# ifndef HAVE_GETEUID
+#  define geteuid() getuid()
+# endif
+# ifndef HAVE_GETEGID
+#  define getegid() getgid()
+# endif
 static int enable_secure;
 # define ENABLE_SECURE (enable_secure == 1)
 # define DETERMINE_SECURE \
@@ -425,6 +440,7 @@ DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category)
   search->category = category;
 
   foundp = (struct known_translation_t **) tfind (search, &root, transcmp);
+  freea (search);
   if (foundp != NULL && (*foundp)->counter == _nl_msg_cat_cntr)
     {
       /* Now deal with plural.  */