diff options
-rw-r--r-- | cpp/include/Ice/IconvStringConverter.h | 17 | ||||
-rw-r--r-- | cpp/src/IceUtil/Thread.cpp | 9 |
2 files changed, 25 insertions, 1 deletions
diff --git a/cpp/include/Ice/IconvStringConverter.h b/cpp/include/Ice/IconvStringConverter.h index 8504ea2f2b0..bf3e0fe52c2 100644 --- a/cpp/include/Ice/IconvStringConverter.h +++ b/cpp/include/Ice/IconvStringConverter.h @@ -15,7 +15,7 @@ #include <algorithm> #include <iconv.h> -#ifdef _LIBICONV_VERSION +#if defined(_LIBICONV_VERSION) || (defined(__sun) && !defined(_XPG6)) // // See http://sourceware.org/bugzilla/show_bug.cgi?id=2962 // @@ -67,6 +67,16 @@ private: // Implementation // +#ifdef __SUNPRO_CC + +extern "C" +{ + typedef void (*IcePthreadKeyDestructor)(void*); +} +#endif + + + template<typename charT> IconvStringConverter<charT>::IconvStringConverter(const char* internalCode) : _internalCode(internalCode) @@ -93,7 +103,12 @@ IconvStringConverter<charT>::IconvStringConverter(const char* internalCode) : throw IceUtil::ThreadSyscallException(__FILE__, __LINE__, GetLastError()); } #else + #ifdef __SUNPRO_CC + int rs = pthread_key_create(&_key, reinterpret_cast<IcePthreadKeyDestructor>(&cleanupKey)); + #else int rs = pthread_key_create(&_key, &cleanupKey); + #endif + if(rs != 0) { throw IceUtil::ThreadSyscallException(__FILE__, __LINE__, rs); diff --git a/cpp/src/IceUtil/Thread.cpp b/cpp/src/IceUtil/Thread.cpp index 6f306f345de..c0694ec351d 100644 --- a/cpp/src/IceUtil/Thread.cpp +++ b/cpp/src/IceUtil/Thread.cpp @@ -7,6 +7,15 @@ // // ********************************************************************** +#ifdef __sun // +// Solaris 10 bug: it's supposed to be defined in pthread.h +// +#ifndef __EXTENSIONS__ +#define __EXTENSIONS__ +#endif +#include <limits.h> +#endif + #include <IceUtil/Thread.h> #include <IceUtil/Time.h> #include <IceUtil/ThreadException.h> |