diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-08-01 18:01:33 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-08-01 18:01:33 +0000 |
commit | b758097d020f2005209c62ab8c4bf8ecefbaa155 (patch) | |
tree | 2c886b690048568660b1f86f91271c791cbd8104 /include | |
parent | c161546c0f53c68fda6b33e597418b38933e89b8 (diff) |
Merged revisions 77869 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r77869 | file | 2007-08-01 14:56:59 -0300 (Wed, 01 Aug 2007) | 2 lines
Add some fixes for building on Solaris.
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@77870 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/threadstorage.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/asterisk/threadstorage.h b/include/asterisk/threadstorage.h index 1fd0f04cf..91e88dc7f 100644 --- a/include/asterisk/threadstorage.h +++ b/include/asterisk/threadstorage.h @@ -62,6 +62,12 @@ struct ast_threadstorage { int (*custom_init)(void *); /*!< Custom initialization function specific to the object */ }; +#ifdef SOLARIS +#define THREADSTORAGE_ONCE_INIT {PTHREAD_ONCE_INIT} +#else +#define THREADSTORAGE_ONCE_INIT PTHREAD_ONCE_INIT +#endif + #if defined(DEBUG_THREADLOCALS) void __ast_threadstorage_object_add(void *key, size_t len, const char *file, const char *function, unsigned int line); void __ast_threadstorage_object_remove(void *key); @@ -103,7 +109,7 @@ void __ast_threadstorage_object_replace(void *key_old, void *key_new, size_t len #define AST_THREADSTORAGE_CUSTOM(name, c_init, c_cleanup) \ static void __init_##name(void); \ static struct ast_threadstorage name = { \ - .once = PTHREAD_ONCE_INIT, \ + .once = THREADSTORAGE_ONCE_INIT, \ .key_init = __init_##name, \ .custom_init = c_init, \ }; \ @@ -115,7 +121,7 @@ static void __init_##name(void) \ #define AST_THREADSTORAGE_CUSTOM(name, c_init, c_cleanup) \ static void __init_##name(void); \ static struct ast_threadstorage name = { \ - .once = PTHREAD_ONCE_INIT, \ + .once = THREADSTORAGE_ONCE_INIT, \ .key_init = __init_##name, \ .custom_init = c_init, \ }; \ |