]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
* bits/libc-tsd.h (__libc_tsd_define, __libc_tsd_address,
authorJakub Jelinek <jakub@redhat.com>
Fri, 7 Nov 2008 15:07:10 +0000 (15:07 +0000)
committerJakub Jelinek <jakub@redhat.com>
Fri, 7 Nov 2008 15:07:10 +0000 (15:07 +0000)
__libc_tsd_get, __libc_tsd_set): Add TYPE argument, use it as the type
of the thread variable instead of void *.
* sysdeps/mach/hurd/bits/libc-tsd.h (__libc_tsd_define,
__libc_tsd_address, __libc_tsd_get, __libc_tsd_set): Likewise.
* include/ctype.h (CTYPE_B, CTYPE_TOUPPER, CTYPE_TOLOWER): Adjust
__libc_tsd_define arguments.
(__ctype_b_loc, __ctype_toupper_loc, __ctype_tolower_loc): Adjust
__libc_tsd_address arguments.  Remove union hack.
* include/rpc/rpc.h (RPC_VARS): Adjust __libc_tsd_define arguments.
* sunrpc/rpc_thread.c (RPC_VARS): Likewise.
(__rpc_thread_destroy, rpc_thread_multi, __rpc_thread_variables):
Adjust __libc_tsd_{set,get} arguments.
* ctype/ctype-info.c (CTYPE_B, CTYPE_TOUPPER, CTYPE_TOLOWER): Adjust
__libc_tsd_define arguments.
* locale/uselocale.c (__uselocale): Adjust __libc_tsd_{set,get}
arguments.
* locale/lc-ctype.c (_nl_postload_ctype): Likewise.
* locale/global-locale.c (__libc_tsd_LOCALE): Adjust type.
(LOCALE): Adjust __libc_tsd_define arguments.
* locale/localeinfo.h (_NL_CURRENT_LOCALE): Adjust __libc_tsd_get
arguments.
(LOCALE): Adjust __libc_tsd_define arguments.
* sysdeps/mach/hurd/malloc-machine.h (MALLOC): Adjust __libc_tsd_define
arguments.
(tsd_setspecific, tsd_getspecific): Adjust __libc_tsd_{set,get}
arguments. nptl/
* sysdeps/pthread/malloc-machine.h (MALLOC): Adjust __libc_tsd_define
arguments.
(tsd_setspecific, tsd_getspecific): Adjust __libc_tsd_{set,get}
arguments.
2008-11-07  Jakub Jelinek  <jakub@redhat.com>

* bits/libc-tsd.h (__libc_tsd_define, __libc_tsd_address,
__libc_tsd_get, __libc_tsd_set): Add TYPE argument, use it as the type
of the thread variable instead of void *.
* sysdeps/mach/hurd/bits/libc-tsd.h (__libc_tsd_define,
__libc_tsd_address, __libc_tsd_get, __libc_tsd_set): Likewise.
* include/ctype.h (CTYPE_B, CTYPE_TOUPPER, CTYPE_TOLOWER): Adjust
__libc_tsd_define arguments.
(__ctype_b_loc, __ctype_toupper_loc, __ctype_tolower_loc): Adjust
__libc_tsd_address arguments.  Remove union hack.
* include/rpc/rpc.h (RPC_VARS): Adjust __libc_tsd_define arguments.
* sunrpc/rpc_thread.c (RPC_VARS): Likewise.
(__rpc_thread_destroy, rpc_thread_multi, __rpc_thread_variables):
Adjust __libc_tsd_{set,get} arguments.
* ctype/ctype-info.c (CTYPE_B, CTYPE_TOUPPER, CTYPE_TOLOWER): Adjust
__libc_tsd_define arguments.
* locale/uselocale.c (__uselocale): Adjust __libc_tsd_{set,get}
arguments.
* locale/lc-ctype.c (_nl_postload_ctype): Likewise.
* locale/global-locale.c (__libc_tsd_LOCALE): Adjust type.
(LOCALE): Adjust __libc_tsd_define arguments.
* locale/localeinfo.h (_NL_CURRENT_LOCALE): Adjust __libc_tsd_get
arguments.
(LOCALE): Adjust __libc_tsd_define arguments.
* sysdeps/mach/hurd/malloc-machine.h (MALLOC): Adjust __libc_tsd_define
arguments.
(tsd_setspecific, tsd_getspecific): Adjust __libc_tsd_{set,get}
arguments.

14 files changed:
ChangeLog
bits/libc-tsd.h
ctype/ctype-info.c
include/ctype.h
include/rpc/rpc.h
locale/global-locale.c
locale/lc-ctype.c
locale/localeinfo.h
locale/uselocale.c
nptl/ChangeLog
nptl/sysdeps/pthread/malloc-machine.h
sunrpc/rpc_thread.c
sysdeps/mach/hurd/bits/libc-tsd.h
sysdeps/mach/hurd/malloc-machine.h

index 197fb7994493868553a8a0d323558438f1a1b721..6f563813fd782117b4e9d604866090fa3da6a036 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,33 @@
+2008-11-07  Jakub Jelinek  <jakub@redhat.com>
+
+       * bits/libc-tsd.h (__libc_tsd_define, __libc_tsd_address,
+       __libc_tsd_get, __libc_tsd_set): Add TYPE argument, use it as the type
+       of the thread variable instead of void *.
+       * sysdeps/mach/hurd/bits/libc-tsd.h (__libc_tsd_define,
+       __libc_tsd_address, __libc_tsd_get, __libc_tsd_set): Likewise.
+       * include/ctype.h (CTYPE_B, CTYPE_TOUPPER, CTYPE_TOLOWER): Adjust
+       __libc_tsd_define arguments.
+       (__ctype_b_loc, __ctype_toupper_loc, __ctype_tolower_loc): Adjust
+       __libc_tsd_address arguments.  Remove union hack.
+       * include/rpc/rpc.h (RPC_VARS): Adjust __libc_tsd_define arguments.
+       * sunrpc/rpc_thread.c (RPC_VARS): Likewise.
+       (__rpc_thread_destroy, rpc_thread_multi, __rpc_thread_variables):
+       Adjust __libc_tsd_{set,get} arguments.
+       * ctype/ctype-info.c (CTYPE_B, CTYPE_TOUPPER, CTYPE_TOLOWER): Adjust
+       __libc_tsd_define arguments.
+       * locale/uselocale.c (__uselocale): Adjust __libc_tsd_{set,get}
+       arguments.
+       * locale/lc-ctype.c (_nl_postload_ctype): Likewise.
+       * locale/global-locale.c (__libc_tsd_LOCALE): Adjust type.
+       (LOCALE): Adjust __libc_tsd_define arguments.
+       * locale/localeinfo.h (_NL_CURRENT_LOCALE): Adjust __libc_tsd_get
+       arguments.
+       (LOCALE): Adjust __libc_tsd_define arguments.
+       * sysdeps/mach/hurd/malloc-machine.h (MALLOC): Adjust __libc_tsd_define
+       arguments.
+       (tsd_setspecific, tsd_getspecific): Adjust __libc_tsd_{set,get}
+       arguments.
+
 2008-11-02  Ulrich Drepper  <drepper@redhat.com>
 
        * malloc/malloc.c (public_rEALLOc): When new arena is used, copy
index d39382952ad1ccadc81525533cba9611b47f4c1e..1a24b701b9fc95f6b1b4bb2be063757eee39cf26 100644 (file)
@@ -1,5 +1,5 @@
 /* libc-internal interface for thread-specific data.  Stub or TLS version.
-   Copyright (C) 1998,2001,02 Free Software Foundation, Inc.
+   Copyright (C) 1998,2001,2002,2008 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
 /* This file defines the following macros for accessing a small fixed
    set of thread-specific `void *' data used only internally by libc.
 
-   __libc_tsd_define(CLASS, KEY)       -- Define or declare a `void *' datum
+   __libc_tsd_define(CLASS, TYPE, KEY) -- Define or declare a datum with TYPE
                                           for KEY.  CLASS can be `static' for
                                           keys used in only one source file,
                                           empty for global definitions, or
                                           `extern' for global declarations.
-   __libc_tsd_address(KEY)             -- Return the `void **' pointing to
+   __libc_tsd_address(TYPE, KEY)       -- Return the `TYPE *' pointing to
                                           the current thread's datum for KEY.
-   __libc_tsd_get(KEY)                 -- Return the `void *' datum for KEY.
-   __libc_tsd_set(KEY, VALUE)          -- Set the datum for KEY to VALUE.
+   __libc_tsd_get(TYPE, KEY)           -- Return the `TYPE' datum for KEY.
+   __libc_tsd_set(TYPE, KEY, VALUE)    -- Set the datum for KEY to VALUE.
 
    The set of available KEY's will usually be provided as an enum,
    and contains (at least):
    translate directly into variables by macro magic.  */
 
 #if USE___THREAD
-# define __libc_tsd_define(CLASS, KEY) \
-  CLASS __thread void *__libc_tsd_##KEY attribute_tls_model_ie;
+# define __libc_tsd_define(CLASS, TYPE, KEY)   \
+  CLASS __thread TYPE __libc_tsd_##KEY attribute_tls_model_ie;
 
-# define __libc_tsd_address(KEY)       (&__libc_tsd_##KEY)
-# define __libc_tsd_get(KEY)           (__libc_tsd_##KEY)
-# define __libc_tsd_set(KEY, VALUE)    (__libc_tsd_##KEY = (VALUE))
+# define __libc_tsd_address(TYPE, KEY)         (&__libc_tsd_##KEY)
+# define __libc_tsd_get(TYPE, KEY)             (__libc_tsd_##KEY)
+# define __libc_tsd_set(TYPE, KEY, VALUE)      (__libc_tsd_##KEY = (VALUE))
 #else
-# define __libc_tsd_define(CLASS, KEY) CLASS void *__libc_tsd_##KEY##_data;
+# define __libc_tsd_define(CLASS, TYPE, KEY)   \
+  CLASS TYPE __libc_tsd_##KEY##_data;
 
-# define __libc_tsd_address(KEY)       (&__libc_tsd_##KEY##_data)
-# define __libc_tsd_get(KEY)           (__libc_tsd_##KEY##_data)
-# define __libc_tsd_set(KEY, VALUE)    (__libc_tsd_##KEY##_data = (VALUE))
+# define __libc_tsd_address(TYPE, KEY)         (&__libc_tsd_##KEY##_data)
+# define __libc_tsd_get(TYPE, KEY)             (__libc_tsd_##KEY##_data)
+# define __libc_tsd_set(TYPE, KEY, VALUE)      (__libc_tsd_##KEY##_data = (VALUE))
 #endif
 
 #endif /* bits/libc-tsd.h */
index 35f2fb540f7f671d2a0be162c7b7e10cbbb02ec7..03b67d179f802ab4b0278a5c7a23814238232b8b 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991,92,95,96,97,99,2000,02 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,95,96,97,99,2000, 2002, 2008
+   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
@@ -20,9 +21,9 @@
 #include <ctype.h>
 #include <locale/localeinfo.h>
 
-__libc_tsd_define (, CTYPE_B)
-__libc_tsd_define (, CTYPE_TOLOWER)
-__libc_tsd_define (, CTYPE_TOUPPER)
+__libc_tsd_define (, const uint16_t *, CTYPE_B)
+__libc_tsd_define (, const int32_t *, CTYPE_TOLOWER)
+__libc_tsd_define (, const int32_t *, CTYPE_TOUPPER)
 
 
 #include <shlib-compat.h>
index ae38b1bf234e8ddf72aeb339b877199ff3dcba21..f4b782e13617428c63565be3a7d20f36934fb353 100644 (file)
@@ -18,50 +18,35 @@ extern int __isctype (int __c, int __mask);
 #   define CTYPE_EXTERN_INLINE extern inline
 #  endif
 
-__libc_tsd_define (extern, CTYPE_B)
-__libc_tsd_define (extern, CTYPE_TOUPPER)
-__libc_tsd_define (extern, CTYPE_TOLOWER)
+__libc_tsd_define (extern, const uint16_t *, CTYPE_B)
+__libc_tsd_define (extern, const int32_t *, CTYPE_TOUPPER)
+__libc_tsd_define (extern, const int32_t *, CTYPE_TOLOWER)
 
 CTYPE_EXTERN_INLINE const uint16_t ** __attribute__ ((const))
 __ctype_b_loc (void)
 {
-  union
-    {
-      void **ptr;
-      const uint16_t **tablep;
-    } u;
-  u.ptr = __libc_tsd_address (CTYPE_B);
-  if (__builtin_expect (*u.tablep == NULL, 0))
-    *u.tablep = (const uint16_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_CLASS) + 128;
-  return u.tablep;
+  const uint16_t **tablep = __libc_tsd_address (const uint16_t *, CTYPE_B);
+  if (__builtin_expect (*tablep == NULL, 0))
+    *tablep = (const uint16_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_CLASS) + 128;
+  return tablep;
 }
 
 CTYPE_EXTERN_INLINE const int32_t ** __attribute__ ((const))
 __ctype_toupper_loc (void)
 {
-  union
-    {
-      void **ptr;
-      const int32_t **tablep;
-    } u;
-  u.ptr = __libc_tsd_address (CTYPE_TOUPPER);
-  if (__builtin_expect (*u.tablep == NULL, 0))
-    *u.tablep = ((int32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOUPPER) + 128);
-  return u.tablep;
+  const int32_t **tablep = __libc_tsd_address (const int32_t *, CTYPE_TOUPPER);
+  if (__builtin_expect (*tablep == NULL, 0))
+    *tablep = ((int32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOUPPER) + 128);
+  return tablep;
 }
 
 CTYPE_EXTERN_INLINE const int32_t ** __attribute__ ((const))
 __ctype_tolower_loc (void)
 {
-  union
-    {
-      void **ptr;
-      const int32_t **tablep;
-    } u;
-  u.ptr = __libc_tsd_address (CTYPE_TOLOWER);
-  if (__builtin_expect (*u.tablep == NULL, 0))
-    *u.tablep = ((int32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOLOWER) + 128);
-  return u.tablep;
+  const int32_t **tablep = __libc_tsd_address (const int32_t *, CTYPE_TOLOWER);
+  if (__builtin_expect (*tablep == NULL, 0))
+    *tablep = ((int32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOLOWER) + 128);
+  return tablep;
 }
 
 # endif        /* Not NOT_IN_libc.  */
index e5b1685f5412faf9facd80604e50dd74847e8e77..d2f30131141c7abb50a6ea436dd0f4deff81b902 100644 (file)
@@ -45,7 +45,7 @@ extern void __rpc_thread_key_cleanup (void);
 
 extern void __rpc_thread_destroy (void);
 
-__libc_tsd_define (extern, RPC_VARS)
+__libc_tsd_define (extern, struct rpc_thread_variables *, RPC_VARS)
 
 #define RPC_THREAD_VARIABLE(x) (__rpc_thread_variables()->x)
 
index 2280f68df47ad3b3c91939702e2c3e9cc229b798..771742e1be2e49dfec6f8d32fadc3e55b5fffee0 100644 (file)
@@ -1,5 +1,5 @@
 /* Locale object representing the global locale controlled by setlocale.
-   Copyright (C) 2002, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2006, 2008 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
@@ -62,9 +62,9 @@ struct __locale_struct _nl_global_locale attribute_hidden =
 #include <tls.h>
 #if HAVE___THREAD
 /* The tsd macros don't permit an initializer.  */
-__thread void *__libc_tsd_LOCALE = &_nl_global_locale;
+__thread __locale_t __libc_tsd_LOCALE = &_nl_global_locale;
 #else
-__libc_tsd_define (, LOCALE)
+__libc_tsd_define (, __locale_t, LOCALE)
 /* This is a bad kludge presuming the variable name used by the macros.
    Using typeof makes sure to barf if we do not match the macro definition.
    This ifndef is a further bad kludge for Hurd, where there is an explicit
index a0a54fbd8d3df5b868bc63609c48cf7046772fe2..f2530afe5c4a7777f7cf93c26a59bf93a107b46b 100644 (file)
@@ -1,5 +1,5 @@
 /* Define current locale data for LC_CTYPE category.
-   Copyright (C) 1995,1996,1997,1998,1999,2000,2002,2003,2005
+   Copyright (C) 1995,1996,1997,1998,1999,2000,2002,2003,2005,2008
        Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -66,10 +66,11 @@ _nl_postload_ctype (void)
      in fact using the global locale.  */
   if (_NL_CURRENT_LOCALE == &_nl_global_locale)
     {
-      __libc_tsd_set (CTYPE_B, (void *) _nl_global_locale.__ctype_b);
-      __libc_tsd_set (CTYPE_TOUPPER,
+      __libc_tsd_set (const uint16_t *, CTYPE_B,
+                     (void *) _nl_global_locale.__ctype_b);
+      __libc_tsd_set (const int32_t *, CTYPE_TOUPPER,
                      (void *) _nl_global_locale.__ctype_toupper);
-      __libc_tsd_set (CTYPE_TOLOWER,
+      __libc_tsd_set (const int32_t *, CTYPE_TOLOWER,
                      (void *) _nl_global_locale.__ctype_tolower);
     }
 
index 5e3e99ca6843f3d745a6a84f10c41b19a6f9933d..3661080bb256c04eb78e26e03105bdc714359755 100644 (file)
@@ -1,5 +1,6 @@
 /* Declarations for internal libc locale interfaces
-   Copyright (C) 1995-2003, 2005, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 1995-2003, 2005, 2006, 2007, 2008
+   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
@@ -203,9 +204,9 @@ extern struct __locale_struct _nl_global_locale attribute_hidden;
 
 /* This fetches the thread-local locale_t pointer, either one set with
    uselocale or &_nl_global_locale.  */
-#define _NL_CURRENT_LOCALE     ((__locale_t) __libc_tsd_get (LOCALE))
+#define _NL_CURRENT_LOCALE     (__libc_tsd_get (__locale_t, LOCALE))
 #include <bits/libc-tsd.h>
-__libc_tsd_define (extern, LOCALE)
+__libc_tsd_define (extern, __locale_t, LOCALE)
 
 
 /* For static linking it is desireable to avoid always linking in the code
index 6a54b58a27bbb1b357e6bbdb8257f2ada6aa2135..ec5dc8f356e180b0d121206a0675a51b1e1ccb20 100644 (file)
@@ -1,5 +1,5 @@
 /* uselocale -- fetch and set the current per-thread locale
-   Copyright (C) 2002, 2004, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2007, 2008 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
@@ -35,7 +35,7 @@ __uselocale (locale_t newloc)
     {
       const locale_t locobj
        = newloc == LC_GLOBAL_LOCALE ? &_nl_global_locale : newloc;
-      __libc_tsd_set (LOCALE, locobj);
+      __libc_tsd_set (__locale_t, LOCALE, locobj);
 
 #ifdef NL_CURRENT_INDIRECT
       /* Now we must update all the per-category thread-local variables to
@@ -63,9 +63,11 @@ __uselocale (locale_t newloc)
 #endif
 
       /* Update the special tsd cache of some locale data.  */
-      __libc_tsd_set (CTYPE_B, (void *) locobj->__ctype_b);
-      __libc_tsd_set (CTYPE_TOLOWER, (void *) locobj->__ctype_tolower);
-      __libc_tsd_set (CTYPE_TOUPPER, (void *) locobj->__ctype_toupper);
+      __libc_tsd_set (const uint16_t *, CTYPE_B, (void *) locobj->__ctype_b);
+      __libc_tsd_set (const int32_t *, CTYPE_TOLOWER,
+                     (void *) locobj->__ctype_tolower);
+      __libc_tsd_set (const int32_t *, CTYPE_TOUPPER,
+                     (void *) locobj->__ctype_toupper);
     }
 
   return oldloc == &_nl_global_locale ? LC_GLOBAL_LOCALE : oldloc;
index bc87e2b4d7e0538c51a58af5aecd18453f556308..dd01d386cdedf8c6783c5a8408be254967d9b217 100644 (file)
@@ -1,3 +1,10 @@
+2008-11-07  Jakub Jelinek  <jakub@redhat.com>
+
+       * sysdeps/pthread/malloc-machine.h (MALLOC): Adjust __libc_tsd_define
+       arguments.
+       (tsd_setspecific, tsd_getspecific): Adjust __libc_tsd_{set,get}
+       arguments.
+
 2008-11-01  Ulrich Drepper  <drepper@redhat.com>
 
        [BZ #6955]
index 33a3d205313cba7044ab5118637a340c9094c454..e99aaa781fad02e3b01cdb5e0b8a6b2026924297 100644 (file)
@@ -1,6 +1,6 @@
 /* Basic platform-independent macro definitions for mutexes,
    thread-specific data and parameters for malloc.
-   Copyright (C) 2003, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2007, 2008 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
@@ -63,10 +63,10 @@ extern void *__dso_handle __attribute__ ((__weak__));
 #include <bits/libc-tsd.h>
 
 typedef int tsd_key_t[1];      /* no key data structure, libc magic does it */
-__libc_tsd_define (static, MALLOC)     /* declaration/common definition */
+__libc_tsd_define (static, void *, MALLOC)     /* declaration/common definition */
 #define tsd_key_create(key, destr)     ((void) (key))
-#define tsd_setspecific(key, data)     __libc_tsd_set (MALLOC, (data))
-#define tsd_getspecific(key, vptr)     ((vptr) = __libc_tsd_get (MALLOC))
+#define tsd_setspecific(key, data)     __libc_tsd_set (void *, MALLOC, (data))
+#define tsd_getspecific(key, vptr)     ((vptr) = __libc_tsd_get (void *, MALLOC))
 
 #include <sysdeps/generic/malloc-machine.h>
 
index 7a9cc9d62fba394c7b202a6530b7066e5ecf9887..796bf086fc32d87af19585cc48a8aac713cac369 100644 (file)
@@ -10,7 +10,7 @@
 
 /* Variable used in non-threaded applications or for the first thread.  */
 static struct rpc_thread_variables __libc_tsd_RPC_VARS_mem;
-__libc_tsd_define (, RPC_VARS)
+__libc_tsd_define (, struct rpc_thread_variables *, RPC_VARS)
 
 /*
  * Task-variable destructor
@@ -18,7 +18,8 @@ __libc_tsd_define (, RPC_VARS)
 void __attribute__ ((section ("__libc_thread_freeres_fn")))
 __rpc_thread_destroy (void)
 {
-       struct rpc_thread_variables *tvp = __libc_tsd_get (RPC_VARS);
+       struct rpc_thread_variables *tvp
+         = __libc_tsd_get (struct rpc_thread_variables *, RPC_VARS);
 
        if (tvp != NULL) {
                __rpc_thread_svc_cleanup ();
@@ -33,7 +34,7 @@ __rpc_thread_destroy (void)
                free (tvp->svc_pollfd_s);
                if (tvp != &__libc_tsd_RPC_VARS_mem)
                        free (tvp);
-               __libc_tsd_set (RPC_VARS, NULL);
+               __libc_tsd_set (struct rpc_thread_variables *, RPC_VARS, NULL);
        }
 }
 #ifdef _LIBC_REENTRANT
@@ -48,7 +49,8 @@ text_set_element (__libc_subfreeres, __rpc_thread_destroy);
 static void
 rpc_thread_multi (void)
 {
-  __libc_tsd_set (RPC_VARS, &__libc_tsd_RPC_VARS_mem);
+  __libc_tsd_set (struct rpc_thread_variables *, RPC_VARS,
+                 &__libc_tsd_RPC_VARS_mem);
 }
 
 
@@ -58,16 +60,18 @@ __rpc_thread_variables (void)
        __libc_once_define (static, once);
        struct rpc_thread_variables *tvp;
 
-       tvp = __libc_tsd_get (RPC_VARS);
+       tvp = __libc_tsd_get (struct rpc_thread_variables *, RPC_VARS);
        if (tvp == NULL) {
                __libc_once (once, rpc_thread_multi);
-               tvp = __libc_tsd_get (RPC_VARS);
+               tvp = __libc_tsd_get (struct rpc_thread_variables *, RPC_VARS);
                if (tvp == NULL) {
                        tvp = calloc (1, sizeof *tvp);
                        if (tvp != NULL)
-                               __libc_tsd_set (RPC_VARS, tvp);
+                               __libc_tsd_set (struct rpc_thread_variables *,
+                                               RPC_VARS, tvp);
                        else
-                               tvp = __libc_tsd_get (RPC_VARS);
+                               tvp = __libc_tsd_get (struct rpc_thread_variables *,
+                                                     RPC_VARS);
                }
        }
        return tvp;
index 56393e930d4fab6af80333d2a818c79a6e36e44a..926dd1fcc19444bb91e034b35971a05dbb19a1fd 100644 (file)
@@ -1,5 +1,5 @@
 /* libc-internal interface for thread-specific data.  Hurd version.
-   Copyright (C) 1998,2002 Free Software Foundation, Inc.
+   Copyright (C) 1998,2002,2008 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
 
 #include <hurd/threadvar.h>
 
-#define __libc_tsd_define(CLASS, KEY) /* nothing, always have threadvars */
+#define __libc_tsd_define(CLASS, TYPE, KEY) /* nothing, always have threadvars */
 
-#define __libc_tsd_address(KEY) \
-  ((void **) __hurd_threadvar_location (_HURD_THREADVAR_##KEY))
-
-#define __libc_tsd_get(KEY)            (*__libc_tsd_address (KEY))
-#define __libc_tsd_set(KEY, VALUE)     (*__libc_tsd_address (KEY) = (VALUE))
+#define __libc_tsd_address(TYPE, KEY) \
+  ((TYPE *) __hurd_threadvar_location (_HURD_THREADVAR_##KEY))
 
+#define __libc_tsd_get(TYPE, KEY) \
+  (*__libc_tsd_address (TYPE, KEY))
+#define __libc_tsd_set(TYPE, KEY, VALUE) \
+  (*__libc_tsd_address (TYPE, KEY) = (VALUE))
 
 #endif /* bits/libc-tsd.h */
index 70aaf11b87fc400b7765ca1b2f330edcdea1768e..e6078f60dc50eee50202f45856e9a337fd1e9ce4 100644 (file)
@@ -1,6 +1,6 @@
 /* Basic platform-independent macro definitions for mutexes,
    thread-specific data and parameters for malloc.
-   Copyright (C) 2003 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2008 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
 #include <bits/libc-tsd.h>
 
 typedef int tsd_key_t[1];      /* no key data structure, libc magic does it */
-__libc_tsd_define (static, MALLOC)     /* declaration/common definition */
+__libc_tsd_define (static, void *, MALLOC)     /* declaration/common definition */
 #define tsd_key_create(key, destr)     ((void) (key))
-#define tsd_setspecific(key, data)     __libc_tsd_set (MALLOC, (data))
-#define tsd_getspecific(key, vptr)     ((vptr) = __libc_tsd_get (MALLOC))
+#define tsd_setspecific(key, data)     __libc_tsd_set (void *, MALLOC, (data))
+#define tsd_getspecific(key, vptr)     ((vptr) = __libc_tsd_get (void *, MALLOC))
 
 #include <sysdeps/generic/malloc-machine.h>