Boost logo

Boost Users :

From: Tom Matelich (tmatelich_at_[hidden])
Date: 2003-02-06 09:53:36


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.
-----------------------------------------------------------------------


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net