diff options
author | Joshua Colp <jcolp@digium.com> | 2007-08-01 18:01:33 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2007-08-01 18:01:33 +0000 |
commit | d9aee5e3532f53f10c324268fe90c20135d9d873 (patch) | |
tree | 2c886b690048568660b1f86f91271c791cbd8104 /include/asterisk/threadstorage.h | |
parent | 28fec17d5943a8cf9a8819a613e8dec74c9b5189 (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: https://origsvn.digium.com/svn/asterisk/trunk@77870 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/threadstorage.h')
-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, \ }; \ |