aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-01 17:56:59 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-01 17:56:59 +0000
commit5e51fc577edc8ebab3b059ae569f2d5a456969a8 (patch)
tree08368ddc04f75c9bdcfd84dd081448238388d898 /include
parentf5efde90a846148c64a056ede06d636c5d3c4833 (diff)
Add some fixes for building on Solaris.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@77869 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/threadstorage.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/asterisk/threadstorage.h b/include/asterisk/threadstorage.h
index f17991957..9021aa551 100644
--- a/include/asterisk/threadstorage.h
+++ b/include/asterisk/threadstorage.h
@@ -43,6 +43,11 @@ struct ast_threadstorage {
void (*key_init)(void);
};
+#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);
@@ -72,7 +77,7 @@ void __ast_threadstorage_object_replace(void *key_old, void *key_new, size_t len
#define AST_THREADSTORAGE_CUSTOM(name, name_init, cleanup) \
static void name_init(void); \
static struct ast_threadstorage name = { \
- .once = PTHREAD_ONCE_INIT, \
+ .once = THREADSTORAGE_ONCE_INIT, \
.key_init = name_init, \
}; \
static void name_init(void) \
@@ -83,7 +88,7 @@ static void name_init(void) \
#define AST_THREADSTORAGE_CUSTOM(name, name_init, cleanup) \
static void name_init(void); \
static struct ast_threadstorage name = { \
- .once = PTHREAD_ONCE_INIT, \
+ .once = THREADSTORAGE_ONCE_INIT, \
.key_init = name_init, \
}; \
static void __cleanup_##name(void *data) \