]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Don't use __libc_* symbols on non-glibc platforms.
authorBruno Haible <bruno@clisp.org>
Mon, 19 Jun 2006 10:48:52 +0000 (10:48 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:13:24 +0000 (12:13 +0200)
gettext-runtime/intl/ChangeLog
gettext-runtime/intl/bindtextdom.c
gettext-runtime/intl/dcigettext.c
gettext-runtime/intl/finddomain.c
gettext-runtime/intl/textdomain.c
gettext-runtime/m4/ChangeLog
gettext-runtime/m4/gettext.m4

index fb33c4273bf2340e75d87f7c71fec71d0959c8c1..aaa86ad8b6342601904710d0c684879ece52b2f1 100644 (file)
@@ -1,3 +1,23 @@
+2006-06-17  Bruno Haible  <bruno@clisp.org>
+
+       * bindtextdom.c (gl_rwlock_define, gl_rwlock_wrlock, gl_rwlock_unlock)
+       [_LIBC]: New macros.
+       (_nl_state_lock, set_binding_values): Use gl_rwlock_* instead of
+       __libc_rwlock_*.
+       * dcigettext.c (gl_rwlock_define_initialized, gl_rwlock_rdlock,
+       gl_rwlock_wrlock, gl_rwlock_unlock) [_LIBC]: New macros.
+       (tree_lock, _nl_state_lock, DCIGETTEXT): Use gl_rwlock_* instead of
+       __libc_rwlock_*.
+       * finddomain.c (gl_rwlock_define_initialized, gl_rwlock_rdlock,
+       gl_rwlock_wrlock, gl_rwlock_unlock) [_LIBC]: New macros.
+       (_nl_find_domain): Use gl_rwlock_* instead of __libc_rwlock_*.
+       * textdomain.c (gl_rwlock_define, gl_rwlock_wrlock, gl_rwlock_unlock)
+       [_LIBC]: New macros.
+       (_nl_state_lock, TEXTDOMAIN): Use gl_rwlock_* instead of
+       __libc_rwlock_*.
+       Needed because NetBSD 3.0 <pthread.h> does
+       #define pthread_rwlock_rdlock __libc_rwlock_rdlock etc.
+
 2006-06-17  Bruno Haible  <bruno@clisp.org>
 
        * config.charset: Update for NetBSD 3.0.
index 405bdad66dfe3738a7486097538dc02023cce0b8..d1b1f9028f3c3fdda1fcab92230eea629267b27d 100644 (file)
@@ -1,5 +1,5 @@
 /* Implementation of the bindtextdomain(3) function
-   Copyright (C) 1995-1998, 2000-2003, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1995-1998, 2000-2003, 2005-2006 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU Library General Public License as published
@@ -34,6 +34,9 @@
 /* Handle multi-threaded applications.  */
 #ifdef _LIBC
 # include <bits/libc-lock.h>
+# define gl_rwlock_define __libc_rwlock_define
+# define gl_rwlock_wrlock __libc_rwlock_wrlock
+# define gl_rwlock_unlock __libc_rwlock_unlock
 #else
 # include "lock.h"
 #endif
@@ -63,7 +66,7 @@ libc_hidden_proto (_nl_default_dirname)
 extern struct binding *_nl_domain_bindings;
 
 /* Lock variable to protect the global data in the gettext implementation.  */
-__libc_rwlock_define (extern, _nl_state_lock attribute_hidden)
+gl_rwlock_define (extern, _nl_state_lock attribute_hidden)
 
 
 /* Names for the libintl functions are a problem.  They must not clash
@@ -104,7 +107,7 @@ set_binding_values (const char *domainname,
       return;
     }
 
-  __libc_rwlock_wrlock (_nl_state_lock);
+  gl_rwlock_wrlock (_nl_state_lock);
 
   modified = 0;
 
@@ -326,7 +329,7 @@ set_binding_values (const char *domainname,
   if (modified)
     ++_nl_msg_cat_cntr;
 
-  __libc_rwlock_unlock (_nl_state_lock);
+  gl_rwlock_unlock (_nl_state_lock);
 }
 
 /* Specify that the DOMAINNAME message catalog will be found
index 861c49cd46e0846babf1396fe64f415f5b5a674a..456ff7f25599d32f44d7d7623adf2eb93fefe27d 100644 (file)
@@ -106,6 +106,10 @@ extern int errno;
 /* Handle multi-threaded applications.  */
 #ifdef _LIBC
 # include <bits/libc-lock.h>
+# define gl_rwlock_define_initialized __libc_rwlock_define_initialized
+# define gl_rwlock_rdlock __libc_rwlock_rdlock
+# define gl_rwlock_wrlock __libc_rwlock_wrlock
+# define gl_rwlock_unlock __libc_rwlock_unlock
 #else
 # include "lock.h"
 #endif
@@ -261,7 +265,7 @@ struct known_translation_t
 #if defined HAVE_TSEARCH || defined _LIBC
 # include <search.h>
 
-__libc_rwlock_define_initialized (static, tree_lock)
+gl_rwlock_define_initialized (static, tree_lock)
 
 static void *root;
 
@@ -430,7 +434,7 @@ typedef unsigned char transmem_block_t;
 #endif
 
 /* Lock variable to protect the global data in the gettext implementation.  */
-__libc_rwlock_define_initialized (, _nl_state_lock attribute_hidden)
+gl_rwlock_define_initialized (, _nl_state_lock attribute_hidden)
 
 /* Checking whether the binaries runs SUID must be done and glibc provides
    easier methods therefore we make a difference here.  */
@@ -517,7 +521,7 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
            : n == 1 ? (char *) msgid1 : (char *) msgid2);
 #endif
 
-  __libc_rwlock_rdlock (_nl_state_lock);
+  gl_rwlock_rdlock (_nl_state_lock);
 
   /* If DOMAINNAME is NULL, we are interested in the default domain.  If
      CATEGORY is not LC_MESSAGES this might not make much sense but the
@@ -572,11 +576,11 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
 
   /* Since tfind/tsearch manage a balanced tree, concurrent tfind and
      tsearch calls can be fatal.  */
-  __libc_rwlock_rdlock (tree_lock);
+  gl_rwlock_rdlock (tree_lock);
 
   foundp = (struct known_translation_t **) tfind (search, &root, transcmp);
 
-  __libc_rwlock_unlock (tree_lock);
+  gl_rwlock_unlock (tree_lock);
 
   freea (search);
   if (foundp != NULL && (*foundp)->counter == _nl_msg_cat_cntr)
@@ -588,7 +592,7 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
       else
        retval = (char *) (*foundp)->translation;
 
-      __libc_rwlock_unlock (_nl_state_lock);
+      gl_rwlock_unlock (_nl_state_lock);
       return retval;
     }
 #endif
@@ -799,13 +803,13 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
                      newp->translation = retval;
                      newp->translation_length = retlen;
 
-                     __libc_rwlock_wrlock (tree_lock);
+                     gl_rwlock_wrlock (tree_lock);
 
                      /* Insert the entry in the search tree.  */
                      foundp = (struct known_translation_t **)
                        tsearch (newp, &root, transcmp);
 
-                     __libc_rwlock_unlock (tree_lock);
+                     gl_rwlock_unlock (tree_lock);
 
                      if (foundp == NULL
                          || __builtin_expect (*foundp != newp, 0))
@@ -828,7 +832,7 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
              if (plural)
                retval = plural_lookup (domain, n, retval, retlen);
 
-             __libc_rwlock_unlock (_nl_state_lock);
+             gl_rwlock_unlock (_nl_state_lock);
              return retval;
            }
        }
@@ -837,7 +841,7 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
  return_untranslated:
   /* Return the untranslated MSGID.  */
   FREE_BLOCKS (block_list);
-  __libc_rwlock_unlock (_nl_state_lock);
+  gl_rwlock_unlock (_nl_state_lock);
 #ifndef _LIBC
   if (!ENABLE_SECURE)
     {
index 9501d694158a5499da1a7229f54fa4fa04737fd0..a25bebcb9e69e5d83beee8f846dad5f546febd5d 100644 (file)
 /* Handle multi-threaded applications.  */
 #ifdef _LIBC
 # include <bits/libc-lock.h>
+# define gl_rwlock_define_initialized __libc_rwlock_define_initialized
+# define gl_rwlock_rdlock __libc_rwlock_rdlock
+# define gl_rwlock_wrlock __libc_rwlock_wrlock
+# define gl_rwlock_unlock __libc_rwlock_unlock
 #else
 # include "lock.h"
 #endif
@@ -81,8 +85,8 @@ _nl_find_domain (const char *dirname, char *locale,
    */
 
   /* We need to protect modifying the _NL_LOADED_DOMAINS data.  */
-  __libc_rwlock_define_initialized (static, lock);
-  __libc_rwlock_rdlock (lock);
+  gl_rwlock_define_initialized (static, lock);
+  gl_rwlock_rdlock (lock);
 
   /* If we have already tested for this locale entry there has to
      be one data set in the list of loaded domains.  */
@@ -90,7 +94,7 @@ _nl_find_domain (const char *dirname, char *locale,
                               strlen (dirname) + 1, 0, locale, NULL, NULL,
                               NULL, NULL, domainname, 0);
 
-  __libc_rwlock_unlock (lock);
+  gl_rwlock_unlock (lock);
 
   if (retval != NULL)
     {
@@ -142,7 +146,7 @@ _nl_find_domain (const char *dirname, char *locale,
                           &codeset, &normalized_codeset);
 
   /* We need to protect modifying the _NL_LOADED_DOMAINS data.  */
-  __libc_rwlock_wrlock (lock);
+  gl_rwlock_wrlock (lock);
 
   /* Create all possible locale entries which might be interested in
      generalization.  */
@@ -151,7 +155,7 @@ _nl_find_domain (const char *dirname, char *locale,
                               codeset, normalized_codeset, modifier,
                               domainname, 1);
 
-  __libc_rwlock_unlock (lock);
+  gl_rwlock_unlock (lock);
 
   if (retval == NULL)
     /* This means we are out of core.  */
index 23e91c8743c498a2bdcb66f610a17da20b687782..c316460fd5de3c4e24c0450df9294b7b5759d9ef 100644 (file)
@@ -1,5 +1,5 @@
 /* Implementation of the textdomain(3) function.
-   Copyright (C) 1995-1998, 2000-2003, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1995-1998, 2000-2003, 2005-2006 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU Library General Public License as published
@@ -33,6 +33,9 @@
 /* Handle multi-threaded applications.  */
 #ifdef _LIBC
 # include <bits/libc-lock.h>
+# define gl_rwlock_define __libc_rwlock_define
+# define gl_rwlock_wrlock __libc_rwlock_wrlock
+# define gl_rwlock_unlock __libc_rwlock_unlock
 #else
 # include "lock.h"
 #endif
@@ -68,7 +71,7 @@ extern const char *_nl_current_default_domain attribute_hidden;
 #endif
 
 /* Lock variable to protect the global data in the gettext implementation.  */
-__libc_rwlock_define (extern, _nl_state_lock attribute_hidden)
+gl_rwlock_define (extern, _nl_state_lock attribute_hidden)
 
 /* Set the current default message catalog to DOMAINNAME.
    If DOMAINNAME is null, return the current default.
@@ -83,7 +86,7 @@ TEXTDOMAIN (const char *domainname)
   if (domainname == NULL)
     return (char *) _nl_current_default_domain;
 
-  __libc_rwlock_wrlock (_nl_state_lock);
+  gl_rwlock_wrlock (_nl_state_lock);
 
   old_domain = (char *) _nl_current_default_domain;
 
@@ -127,7 +130,7 @@ TEXTDOMAIN (const char *domainname)
        free (old_domain);
     }
 
-  __libc_rwlock_unlock (_nl_state_lock);
+  gl_rwlock_unlock (_nl_state_lock);
 
   return new_domain;
 }
index f2cf990f51306851ea217a834ad0b90514663dd0..dbfb69693045c96480b5e036502549c31cb78341 100644 (file)
@@ -1,3 +1,7 @@
+2006-06-17  Bruno Haible  <bruno@clisp.org>
+
+       * gettext.m4 (AM_INTL_SUBDIR): Don't redefine __libc_rwlock_* symbols.
+
 2006-06-17  Bruno Haible  <bruno@clisp.org>
 
        * po.m4 (AM_POSTPROCESS_PO_MAKEFILE): Remove double-quotes around
index 0048586adc941b21e953ff122f1bb75425bed558..5f834100e2cf66a4e6a98c9fd5e744ba3d5849fe 100644 (file)
@@ -1,4 +1,4 @@
-# gettext.m4 serial 50 (gettext-0.15)
+# gettext.m4 serial 51 (gettext-0.15)
 dnl Copyright (C) 1995-2006 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -445,13 +445,6 @@ AC_DEFUN([AM_INTL_SUBDIR],
 #define __libc_lock_init                gl_lock_init
 #define __libc_lock_lock                gl_lock_lock
 #define __libc_lock_unlock              gl_lock_unlock
-#define __libc_rwlock_t                   gl_rwlock_t
-#define __libc_rwlock_define              gl_rwlock_define
-#define __libc_rwlock_define_initialized  gl_rwlock_define_initialized
-#define __libc_rwlock_init                gl_rwlock_init
-#define __libc_rwlock_rdlock              gl_rwlock_rdlock
-#define __libc_rwlock_wrlock              gl_rwlock_wrlock
-#define __libc_rwlock_unlock              gl_rwlock_unlock
 #define __libc_lock_recursive_t                   gl_recursive_lock_t
 #define __libc_lock_define_recursive              gl_recursive_lock_define
 #define __libc_lock_define_initialized_recursive  gl_recursive_lock_define_initialized