Fix loop construction to functions calls
[glibc.git] / nptl / tst-tls5.h
blob12f68b81963e05df22661e74ccb72d3a87807ad5
1 #include <stdint.h>
2 #include <stdlib.h>
3 #include <tls.h>
6 struct tls_obj
8 const char *name;
9 uintptr_t addr;
10 size_t size;
11 size_t align;
13 extern struct tls_obj tls_registry[];
15 #define TLS_REGISTER(x) \
16 static void __attribute__((constructor)) \
17 tls_register_##x (void) \
18 { \
19 size_t i; \
20 for (i = 0; tls_registry[i].name; ++i); \
21 tls_registry[i].name = #x; \
22 tls_registry[i].addr = (uintptr_t) &x; \
23 tls_registry[i].size = sizeof (x); \
24 tls_registry[i].align = __alignof__ (x); \