Conflict with winapi.hpp and windows.h (manifested in ACE)
Intel C++ 7.0 for Windows, STLPort 4.5.3, boost 1.29, ACE 5.3 Intel was warning a bunch of bad code in my source base, so I turned on warnings as errors, then I hit a problem where ACE was calling InitializeCriticalSection with a pointer to its typedef of CRITICAL_SECTION, and it was using the declaration of InitializeCriticalSection in winapi.hpp. Turns out, in the standard (by my interpretation), section 7.5/6 that if you put an extern "C" declaration in a namespace, its also accessible by ::. The call failed because boost::detail::winapi::critical_section != CRITICAL_SECTION. I ended up ifdef'ing the declaration of critical_section like so: #ifndef _WINBASE_ //header guard for winbase.h. struct critical_section { struct critical_section_debug * DebugInfo; long_type LockCount; long_type RecursionCount; handle_type OwningThread; handle_type LockSemaphore; ulong_ptr_type SpinCount; }; #else typedef CRITICAL_SECTION critical_section; #endif Please advise if you have a better solution. Tom Matelich Pardon the disclaimer... ----------------------------------------------------------------------- DISCLAIMER: Information contained in this message and/or attachment(s) may contain confidential information of Zetec, Inc. If you have received this transmission in error, please notify the sender by return email. -----------------------------------------------------------------------
Tom Matelich wrote:
Intel C++ 7.0 for Windows, STLPort 4.5.3, boost 1.29, ACE 5.3
Intel was warning a bunch of bad code in my source base, so I turned on warnings as errors, then I hit a problem where ACE was calling InitializeCriticalSection with a pointer to its typedef of CRITICAL_SECTION, and it was using the declaration of InitializeCriticalSection in winapi.hpp.
Turns out, in the standard (by my interpretation), section 7.5/6 that if you put an extern "C" declaration in a namespace, its also accessible by ::. The call failed because boost::detail::winapi::critical_section != CRITICAL_SECTION.
I think I fixed that in the CVS. The critical section functions are now only
declared when BOOST_LWM_USE_CRITICAL_SECTION is defined, and there is an
option (BOOST_USE_WINDOWS_H) to just include
participants (2)
-
Peter Dimov
-
Tom Matelich