Boost logo

Boost Users :

From: Bill Somerville (Bill.Somerville_at_[hidden])
Date: 2006-03-21 04:29:51


More info on this one:

I tried commenting out the compare_exchange() fn and the forwarding
fns it uses and switched to directly calling
InterlockedExchangeCompare() in boost/thread/src/once.cpp and this
fixed the problem. I also see the error in a vanilla boost build for
AMD64 Windows - has anyone tested this code on 64-bit Windows?

I suppose it's a compiler bug as (although I'm not completely sure)
it knows that the address of the fn is only used in inline fns that
call it. Also it seems to compile OK on the IA64 compiler without
this change.

Bill Somerville

On 20 Mar 2006, at 16:15, Bill Somerville wrote:

Hi

I'm having trouble linking a program that uses boost::call_once() on
a Windows AMD64 machine.

I get a link error saying _InterlockedCompareExchange() is undefined
- this should be an intrinsic function on this platform but I think
the code in thread/src/once.cpp where the address is taken of the
intrinsic function has fooled the development system. It works OK on
IA64 were the function is also intrinsic.

We are building statically so it's possible that we are not passing
some compiler switch that fixes this - but I don't see it.

Has anyone else hit this problem with 64-bit AMD64 code and
boost::call_once() on Windows?

Compiler version is: Microsoft (R) C/C++ Optimizing Compiler Version
14.00.40121 for AMD64

Bill Somerville

_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users


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