From c60535e7a8de7640e726d6b3948d05ab8ace5281 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Tue, 19 May 2009 17:23:16 +0000 Subject: [PATCH] Tue May 19 12:00:30 CDT 2009 Pekka Pessi * su_uniqueid.c: Solaris misdefines PTHREAD_ONCE_INIT Ignore-this: 9fe2247164d572901ed4a30b009353db Solaris defines pthread_once_t as a struct containing an array. The initializer PTHREAD_ONCE_INIT needs two levels of brackets it but only has one. Original patch from Mike Jerris . git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13387 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- libs/sofia-sip/.update | 2 +- libs/sofia-sip/libsofia-sip-ua/su/su_uniqueid.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/libs/sofia-sip/.update b/libs/sofia-sip/.update index ecefa7fd5d..902eb06483 100644 --- a/libs/sofia-sip/.update +++ b/libs/sofia-sip/.update @@ -1 +1 @@ -Tue May 19 09:46:18 CDT 2009 +Tue May 19 12:23:01 CDT 2009 diff --git a/libs/sofia-sip/libsofia-sip-ua/su/su_uniqueid.c b/libs/sofia-sip/libsofia-sip-ua/su/su_uniqueid.c index ed278f3121..f27f87beb5 100644 --- a/libs/sofia-sip/libsofia-sip-ua/su/su_uniqueid.c +++ b/libs/sofia-sip/libsofia-sip-ua/su/su_uniqueid.c @@ -84,11 +84,12 @@ union state { #include -#if defined(__sun) -static pthread_once_t once = { PTHREAD_ONCE_INIT }; -#else -static pthread_once_t once = PTHREAD_ONCE_INIT; +#if __sun +#undef PTHREAD_ONCE_INIT +#define PTHREAD_ONCE_INIT {{ 0, 0, 0, PTHREAD_ONCE_NOTDONE }} #endif + +static pthread_once_t once = PTHREAD_ONCE_INIT; static int done_once = 1; static pthread_key_t state_key;