From 2706de850a943d82664f35bad8cc64ca64ee9afe Mon Sep 17 00:00:00 2001 From: Sean Bright Date: Mon, 28 Dec 2009 15:22:54 +0000 Subject: 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 --- include/asterisk/threadstorage.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'include/asterisk/threadstorage.h') 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, \ }; \ -- cgit v1.2.3