Boost logo

Boost :

From: Bronek Kozicki (brok_at_[hidden])
Date: 2005-04-23 16:38:16


Peter Dimov wrote:
> Indirectly. interlocked.hpp is included by shared_ptr.hpp on Windows.
> Comeau doesn't compile it even without --a, because it doesn't seem to
> recognize __stdcall. And since the functions that interlocked.hpp
> attempts to import from the Windows kernel are indeed __stdcall, this
> makes it impossible for interlocked.hpp to do its job.
>
> This can be fixed by defining BOOST_SP_DISABLE_THREADS for the Comeau
> toolset.

Are you sure? I tried very simple program using shared_ptr and it's OK
in non-strict mode, but does not compile in strict mode. The only
difference is --a switch. In strict mode it chokes on interlocked.hpp
header, but apparently the very same header is accepted in non-strict
mode. Which would mean that without --a switch Comeau knows how to deal
with __stdcall. Actually I'm pretty sure that wihout --a como can
compile program than includes Windows headers, I tried it more than
once. Or maybe I misunderstood something and some different experiment
would be relevant (but not the one shown below)?

Regards

B.

PS. experiment details:

MSYS>cat T680.cpp
#include <boost/shared_ptr.hpp>
struct A {};
int main()
{
   boost::shared_ptr<A> a = new A();
}

MSYS>como -IG:\boost T680.cpp
Comeau C/C++ 4.3.3 (Jan 13 2004 11:29:09) for MS_WINDOWS_x86
Copyright 1988-2003 Comeau Computing. All rights reserved.
MODE:non-strict warnings microsoft C++

MSYS>como --a -IG:\boost T680.cpp
Comeau C/C++ 4.3.3 (Jan 13 2004 11:29:09) for MS_WINDOWS_x86
Copyright 1988-2003 Comeau Computing. All rights reserved.
MODE:strict warnings C++

"G:\boost\boost/detail/interlocked.hpp", line 52: error: identifier
"dllimport"
           is undefined
   extern "C" __declspec(dllimport) long __stdcall InterlockedIncrement(
long volatile * );
                         ^

"G:\boost\boost/detail/interlocked.hpp", line 52: warning: omission of
           explicit type is nonstandard ("int" assumed)
   extern "C" __declspec(dllimport) long __stdcall InterlockedIncrement(
long volatile * );
              ^

"G:\boost\boost/detail/interlocked.hpp", line 52: error: expected a "{"
   extern "C" __declspec(dllimport) long __stdcall InterlockedIncrement(
long volatile * );
                                    ^


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk