summaryrefslogtreecommitdiff
path: root/cpp/include
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/include')
-rw-r--r--cpp/include/Ice/IconvStringConverter.h17
1 files changed, 16 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);