|
|
|
|||||
|
OpenSSLPluginI.cpp problem on FreeBSD-CURRENT
Hi,
I am using: FreeBSD-CURRENT gcc version 3.2.2 [FreeBSD] 20030205 (release) On FreeBSD, pthread_t is a typedef for "struct pthread *" When compiling IceSSL, I get this error: OpenSSLPluginI.cpp: In function `long unsigned int idFunction()': OpenSSLPluginI.cpp:151: invalid static_cast from type `pthread*' to type `long unsigned int' Why is a static_cast necessary for this code? If I change to a C-style cast, the problem goes away: --- OpenSSLPluginI.cpp.orig Wed May 28 17:58:00 2003 +++ OpenSSLPluginI.cpp Thu May 29 22:34:13 2003 @@ -148,7 +152,7 @@ #ifdef _WIN32 return static_cast<unsigned long>(GetCurrentThreadId()); #else - return static_cast<unsigned long>(pthread_self()); + return (unsigned long)pthread_self(); #endif } }
__________________
-- Craig Rodrigues |
|
|||||
|
OK, then I submit this patch.
--- OpenSSLPluginI.cpp.orig Wed May 28 17:58:00 2003 +++ OpenSSLPluginI.cpp Fri May 30 08:51:42 2003 @@ -147,6 +151,8 @@ { #ifdef _WIN32 return static_cast<unsigned long>(GetCurrentThreadId()); +#elif defined(__FreeBSD__) + return reinterpret_cast<unsigned long>(pthread_self()); #else return static_cast<unsigned long>(pthread_self()); #endif
__________________
-- Craig Rodrigues |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| a problem about how to modify a value at the iterator’s current position! | fw_csha | Help Center | 1 | 03-01-2005 10:34 AM |
| OpenSSLPluginI.cpp, invalid static cast on FreeBSD | rodrigc | Patches | 0 | 02-27-2003 12:08 PM |
| Working on FreeBSD-CURRENT port | rodrigc | Patches | 7 | 02-23-2003 09:58 PM |
| FreeBSD compilation problem: EPROTO undeclared | rodrigc | Bug Reports | 1 | 02-22-2003 06:53 PM |
| FreeBSD compilation problem: pthread_t is not unsigned long | rodrigc | Bug Reports | 2 | 02-22-2003 06:49 PM |