diff options
Diffstat (limited to 'cpp/src/IceSSL/OpenSSLPluginI.cpp')
-rw-r--r-- | cpp/src/IceSSL/OpenSSLPluginI.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/cpp/src/IceSSL/OpenSSLPluginI.cpp b/cpp/src/IceSSL/OpenSSLPluginI.cpp index 522888a9a5a..0dec2723057 100644 --- a/cpp/src/IceSSL/OpenSSLPluginI.cpp +++ b/cpp/src/IceSSL/OpenSSLPluginI.cpp @@ -114,7 +114,6 @@ namespace IceSSL extern "C" { void lockingCallback(int, int, const char*, int); - unsigned long idFunction(); } @@ -145,25 +144,20 @@ void IceSSL::lockingCallback(int mode, int type, const char *file, int line) } } -unsigned long IceSSL::idFunction() +unsigned long +IceSSL::idFunction() { - unsigned long threadID = 0; - #ifdef _WIN32 - threadID = GetCurrentThreadId(); -#elif _POSIX_THREADS - threadID = pthread_self(); + return static_cast<unsigned long>(GetCurrentThreadId()); #else - #error You must define a method to return the current thread ID. + return static_cast<unsigned long>(pthread_self()); #endif - - return threadID; } IceSSL::SslLockKeeper::SslLockKeeper() { - CRYPTO_set_id_callback((unsigned long(*)())IceSSL::idFunction); - CRYPTO_set_locking_callback((void (*)(int, int, const char*, int))IceSSL::lockingCallback); + CRYPTO_set_id_callback(IceSSL::idFunction); + CRYPTO_set_locking_callback(IceSSL::lockingCallback); } IceSSL::SslLockKeeper::~SslLockKeeper() |