1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- #ifndef _BITS_LIBC_TSD_H
- #define _BITS_LIBC_TSD_H 1
- #include <features.h>
- enum __libc_tsd_key_t { _LIBC_TSD_KEY_MALLOC = 0,
- _LIBC_TSD_KEY_DL_ERROR,
- _LIBC_TSD_KEY_N };
- extern void *(*__libc_internal_tsd_get) __P ((enum __libc_tsd_key_t));
- extern int (*__libc_internal_tsd_set) __P ((enum __libc_tsd_key_t,
- __const void *));
- #define __libc_tsd_define(CLASS, KEY) CLASS void *__libc_tsd_##KEY##_data;
- #define __libc_tsd_get(KEY) \
- (__libc_internal_tsd_get != NULL \
- ? __libc_internal_tsd_get (_LIBC_TSD_KEY_##KEY) \
- : __libc_tsd_##KEY##_data)
- #define __libc_tsd_set(KEY, VALUE) \
- (__libc_internal_tsd_set != NULL \
- ? __libc_internal_tsd_set (_LIBC_TSD_KEY_##KEY, (VALUE)) \
- : ((__libc_tsd_##KEY##_data = (VALUE)), 0))
- #endif
|