summaryrefslogtreecommitdiff
path: root/cpp/include/Ice/IconvStringConverter.h
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2007-07-17 12:55:47 -0400
committerBernard Normier <bernard@zeroc.com>2007-07-17 12:55:47 -0400
commitede6d16eaadf02bb49e46f774adf4238dba090e8 (patch)
tree2c219496fb09f9b41641bed906488e57c9c37793 /cpp/include/Ice/IconvStringConverter.h
parentBuild fix (diff)
downloadice-ede6d16eaadf02bb49e46f774adf4238dba090e8.tar.bz2
ice-ede6d16eaadf02bb49e46f774adf4238dba090e8.tar.xz
ice-ede6d16eaadf02bb49e46f774adf4238dba090e8.zip
Build fixes
Diffstat (limited to 'cpp/include/Ice/IconvStringConverter.h')
-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);