Boost logo

Boost Users :

Subject: [Boost-users] [intrusive,thread] Problems with VS in 64-bit mode
From: Zeljko Vrba (zvrba_at_[hidden])
Date: 2008-12-28 03:08:51


I'm trying to use thread and intrusive libraries with VS 2008 (9.0.21022.8)
In 32-bit mode (Win32 platform) everything works just fine. However, when
I switch the configuration to x64, two problems appear:

Intrusive problem:
==================

With default settings, just including <boost/intrusive/list.hpp> produces
the follwing error:

C:\Users\zvrba\Work\boost_1_37_0\boost/intrusive/detail/mpl.hpp(191) :
error C2953: 'boost::intrusive::detail::is_unary_or_binary_function_impl
<R(__cdecl *)(T0)>' : class template has already been defined

I have traced that back to the BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS define,
which is active when compiling with MS extensions turned on.

Thread problem:
===============

I turned off MS extensions, and this fixes the problem with the intrusive
library (the header is included before the thread header). However, then I
get the following error:

C:\Users\zvrba\Work\boost_1_37_0\boost/config/requires_threads.hpp(29) :
fatal error C1189: #error : "Threading support unavaliable: it has been
explicitly disabled with BOOST_DISABLE_THREADS"

This error is dependent on the language extensions being enabled or not.

Fix:
====

I have temporarily solved the problem by hacking the list.hpp header:

#if defined(_MSC_EXTENSIONS) && !defined(__BORLAND__)
//#define BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS
#endif

(the commented line is the fix). The cause is probably the following
comment in the documentation:

"On Itanium Processor Family (IPF) and x64 processors, __cdecl is accepted and
ignored by the compiler" (same for __stdcall)

This makes the decorated and undecorated signatures equivalent, so I tend
to believe that this fix would be correct with the additional
[&& !defined(_WIN64)] clause.


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