summaryrefslogtreecommitdiff
path: root/include/asterisk/threadstorage.h
diff options
context:
space:
mode:
authorSean Bright <sean@malleable.com>2009-12-28 15:22:54 +0000
committerSean Bright <sean@malleable.com>2009-12-28 15:22:54 +0000
commit2706de850a943d82664f35bad8cc64ca64ee9afe (patch)
tree0d615cc2880a202b9a3d1ad88595ee1c8c1e05f4 /include/asterisk/threadstorage.h
parent82446789f3ede6416eeba2ac4abf0afd52259ba4 (diff)
Merged revisions 236585 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r236585 | seanbright | 2009-12-28 10:12:08 -0500 (Mon, 28 Dec 2009) | 7 lines Try a test compile to see if PTHREAD_ONCE_INIT requires extra braces. There was conditional code (based on build platform) to optioinally wrap PTHREAD_ONCE_INIT in braces that was removed since it is fixed in newer versions of Solaris/OpenSolaris, but I am still running into it on Solaris 10 x86 so add a configure-time check for it. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@236613 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/threadstorage.h')
-rw-r--r--include/asterisk/threadstorage.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/asterisk/threadstorage.h b/include/asterisk/threadstorage.h
index fd4f7847e..74f91cdd7 100644
--- a/include/asterisk/threadstorage.h
+++ b/include/asterisk/threadstorage.h
@@ -103,11 +103,17 @@ void __ast_threadstorage_object_replace(void *key_old, void *key_new, size_t len
*/
#define AST_THREADSTORAGE_CUSTOM(a,b,c) AST_THREADSTORAGE_CUSTOM_SCOPE(a,b,c,static)
+#if defined(PTHREAD_ONCE_INIT_NEEDS_BRACES)
+# define AST_PTHREAD_ONCE_INIT { PTHREAD_ONCE_INIT }
+#else
+# define AST_PTHREAD_ONCE_INIT PTHREAD_ONCE_INIT
+#endif
+
#if !defined(DEBUG_THREADLOCALS)
#define AST_THREADSTORAGE_CUSTOM_SCOPE(name, c_init, c_cleanup, scope) \
static void __init_##name(void); \
scope struct ast_threadstorage name = { \
- .once = PTHREAD_ONCE_INIT, \
+ .once = AST_PTHREAD_ONCE_INIT, \
.key_init = __init_##name, \
.custom_init = c_init, \
}; \
@@ -119,7 +125,7 @@ static void __init_##name(void) \
#define AST_THREADSTORAGE_CUSTOM_SCOPE(name, c_init, c_cleanup, scope) \
static void __init_##name(void); \
scope struct ast_threadstorage name = { \
- .once = PTHREAD_ONCE_INIT, \
+ .once = AST_PTHREAD_ONCE_INIT, \
.key_init = __init_##name, \
.custom_init = c_init, \
}; \