about summary refs log tree commit diff
path: root/bits/libc-tsd.h
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-11-07 15:07:10 +0000
committerJakub Jelinek <jakub@redhat.com>2008-11-07 15:07:10 +0000
commit4b23f9bda30fc4aca1d0e108bab3fdbd63b0ff59 (patch)
treebf8360059895514a7409ba883f8b658fa62b85bb /bits/libc-tsd.h
parent486bdb886330a250af76cbb12af55d2c67ec0981 (diff)
downloadglibc-4b23f9bda30fc4aca1d0e108bab3fdbd63b0ff59.tar.gz
glibc-4b23f9bda30fc4aca1d0e108bab3fdbd63b0ff59.tar.xz
glibc-4b23f9bda30fc4aca1d0e108bab3fdbd63b0ff59.zip
* 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. 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.
Diffstat (limited to 'bits/libc-tsd.h')
-rw-r--r--bits/libc-tsd.h29
1 files changed, 15 insertions, 14 deletions
diff --git a/bits/libc-tsd.h b/bits/libc-tsd.h
index d39382952a..1a24b701b9 100644
--- a/bits/libc-tsd.h
+++ b/bits/libc-tsd.h
@@ -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
@@ -23,15 +23,15 @@
 /* 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):
@@ -52,18 +52,19 @@
    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 */