Boost logo

Boost :

Subject: [boost] [numeric][intervall] msvc_rounding_control.hpp broken in 64 bit build.
From: Juergen Hunold (juergen.hunold_at_[hidden])
Date: 2010-02-16 10:12:39


Hi !

boost/numeric/interval/detail/msvc_rounding_control.hpp
does not compile in x64 (64bit) build with (at least) msvc-9

The offending commit is:
------------------------------------------------------------------------
r59350 | marshall | 2010-01-29 19:01:34 +0100 (Fri, 29 Jan 2010) | 1
line

Applied patches to fix #2512 and #2513
------------------------------------------------------------------------

This does not show up in regression test because we don't have a test
runner running a 64bit version of msvc.

The compiler bails out on the x86 inline assembler introduced in that
commit when running in 64bit mode.

The simple patch is to fall back to the old behaviour using "rint" for
target "x64":

Index: msvc_rounding_control.hpp
===================================================================
--- msvc_rounding_control.hpp (revision 59697)
+++ msvc_rounding_control.hpp (working copy)
@@ -25,7 +25,7 @@
 namespace interval_lib {
 namespace detail {
 
-#if BOOST_MSVC < 1400
+#if BOOST_MSVC < 1400 || defined(WIN64)
 extern "C" { double rint(double); }
 #else
 inline double rint(double x)

I can apply this if necessary. Tested with msvc-9.0
I have not looked into the referenced tickets.
Any (better) ideas ?

Yours,

Jürgen

-- 
* Dipl.-Math. Jürgen Hunold       ! Ingenieurgesellschaft für 
* voice: ++49 511 262926 57       ! Verkehrs- und Eisenbahnwesen mbH  
* fax  : ++49 511 262926 99       ! Lister Straße 15
* juergen.hunold_at_[hidden]        ! www.ivembh.de
* 
* Geschäftsführer:                ! Sitz des Unternehmens: Hannover
* Prof. Dr.-Ing. Thomas Siefer    ! Amtsgericht Hannover, HRB 56965
* PD Dr.-Ing. Alfons Radtke       !

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