+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.
/* 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
/* 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
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
return;
}
- __libc_rwlock_wrlock (_nl_state_lock);
+ gl_rwlock_wrlock (_nl_state_lock);
modified = 0;
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
/* 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
#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;
#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. */
: 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
/* 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)
else
retval = (char *) (*foundp)->translation;
- __libc_rwlock_unlock (_nl_state_lock);
+ gl_rwlock_unlock (_nl_state_lock);
return retval;
}
#endif
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))
if (plural)
retval = plural_lookup (domain, n, retval, retlen);
- __libc_rwlock_unlock (_nl_state_lock);
+ gl_rwlock_unlock (_nl_state_lock);
return retval;
}
}
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)
{
/* 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
*/
/* 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. */
strlen (dirname) + 1, 0, locale, NULL, NULL,
NULL, NULL, domainname, 0);
- __libc_rwlock_unlock (lock);
+ gl_rwlock_unlock (lock);
if (retval != NULL)
{
&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. */
codeset, normalized_codeset, modifier,
domainname, 1);
- __libc_rwlock_unlock (lock);
+ gl_rwlock_unlock (lock);
if (retval == NULL)
/* This means we are out of core. */
/* 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
/* 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
#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.
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;
free (old_domain);
}
- __libc_rwlock_unlock (_nl_state_lock);
+ gl_rwlock_unlock (_nl_state_lock);
return new_domain;
}
+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
-# 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,
#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