Boost logo

Boost Users :

Subject: [Boost-users] WIN64 vs _WIN64
From: Roberto Fichera (kernel_at_[hidden])
Date: 2012-02-27 09:24:06

Hi All,

I got a compilation error while compiling a library under Win64 arch that includes the

c:\boost_1.48\include\boost/numeric/interval/detail/msvc_rounding_control.hpp(33) : error C4235: nonstandard extension
used : '_asm' keyword not supported on this architecture
c:\boost_1.48\include\boost/numeric/interval/detail/msvc_rounding_control.hpp(33) : error C2065: 'FLD' : undeclared
c:\boost_1.48\include\boost/numeric/interval/detail/msvc_rounding_control.hpp(34) : error C4235: nonstandard extension
used : '_asm' keyword not supported on this architecture

So I checked the code under boost/numeric/interval/detail/msvc_rounding_control.hpp and it seems
that it does a preprocessor check against WIN64 instead of _WIN64

namespace boost {
namespace numeric {
namespace interval_lib {
namespace detail {

#if BOOST_MSVC < 1400 || *defined(WIN64)*
extern "C" { double rint(double); }
inline double rint(double x)
_asm FLD [x] ;
_asm FRNDINT ;
//_asm RET ;

Is there any reason why do not check against _WIN64 instead of WIN64 since the boost
does always check against _WIN64? _WIN64 is also already pre-defined as normal
MSVC definition when targeting x86_64 archs.

[roberto_at_roberto include]$ grep -R WIN64 *
boost/serialization/force_include.hpp:#elif ! defined(_WIN32) && ! defined(_WIN64)
boost/detail/win/synchronization.hpp: #if defined(_WIN64)
boost/detail/win/basic_types.hpp:# ifdef _WIN64
boost/intrusive/detail/mpl.hpp:#if defined(_MSC_EXTENSIONS) && !defined(__BORLAND__) && !defined(_WIN64)
boost/python/converter/builtin_converters.hpp:# if defined(_MSC_VER) && defined(_WIN64) && PY_VERSION_HEX < 0x03000000
boost/xpressive/xpressive_fwd.hpp:# if (defined(_WIN32) || defined(_WIN64) || defined(_WINCE)) \
boost/thread/win32/thread_primitives.hpp:# ifdef _WIN64
boost/regex/config.hpp:# if(defined(_WIN32) || defined(_WIN64) || defined(_WINCE)) \
boost/signals2/detail/lwm_win32_cs.hpp:#if defined(_WIN64)
boost/config/compiler/intel.hpp:#if (!(defined(_WIN32) || defined(_WIN64)) && defined(__STDC_HOSTED__) &&
boost/config/compiler/intel.hpp:#if defined(_WIN32) || defined(_WIN64)
boost/smart_ptr/detail/lwm_win32_cs.hpp:#if defined(_WIN64)
*boost/numeric/interval/detail/msvc_rounding_control.hpp:#if BOOST_MSVC < 1400 || defined(WIN64)*

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at