Boost logo

Boost :

From: Boris Gubenko (Boris.Gubenko_at_[hidden])
Date: 2006-10-24 23:45:43


Boris Gubenko wrote:
> Since alpha_rounding_control.hpp handles both gcc and cxx and <float.h>
> is included only in cxx path, perhaps, it made sense in this case to
> structure the header the way it is structured.

  I've attached a patch for alpha_rounding_control.hpp in case you think
  it would be a good idea to update this header also, to move
  '#include <float.h>' outside the namespace declarations.

  I ran numeric_interval tests on Tru64 with modified header and confirmed,
  that it does not cause any regression (not all numeric_interval tests
  succeed on Tru64, but this is another story).

  I also simplified the header a little bit: checking __digital__ macro is
  redundant: the Digital/Compaq/HP cxx compiler predefines both __DECCXX
  and __digital__ macro and I cannot think of a compiler other than cxx
  that would predefine this macro.

  Boris

Index: alpha_rounding_control.hpp
===================================================================
RCS file:
/cvsroot/boost/boost/boost/numeric/interval/detail/alpha_rounding_control.hpp,v
retrieving revision 1.3
diff -r1.3 alpha_rounding_control.hpp
17c17,21
< #if defined(__GNUC__) || defined(__digital__) || defined(__DECCXX)

---
> #if defined(__DECCXX)
> #include <float.h> // write_rnd() and read_rnd()
> #endif
>
> #if defined(__GNUC__) || defined(__DECCXX)
52c56
< #elif defined(__digital__) || defined(__DECCXX)
---
> #elif defined(__DECCXX)
54c58
< #if defined(__DECCXX) && !(defined(__FLT_ROUNDS) && __FLT_ROUNDS == -1)
---
> #if !(defined(__FLT_ROUNDS) && __FLT_ROUNDS == -1)
58,59d61
< #   include <float.h> // write_rnd() and read_rnd()
<
----- Original Message ----- 
From: "Boris Gubenko" <Boris.Gubenko_at_[hidden]>
To: <boost_at_[hidden]>
Cc: "Boris Gubenko" <Boris.Gubenko_at_[hidden]>
Sent: Tuesday, October 24, 2006 12:36 PM
Subject: Re: [boost] [numeric_interval] patch for HP-UX/ia64
> John Maddock wrote:
>
>> Will do [...]
>
> Thanks!
>
>> [...] but shouldn't the #include of <fenv.h> be outside the namespace
>> declarations?
>
> I asked myself the same question. I modeled ia64_rounding_control.hpp
> after alpha_rounding_control.hpp (for the obvious reason :-) which
> #include's <float.h> inside the namespace declarations.
>
> Since alpha_rounding_control.hpp handles both gcc and cxx and <float.h>
> is included only in cxx path, perhaps, it made sense in this case to
> structure the header the way it is structured. However, there is no
> reason for ia64_rounding_control.hpp to #include <fenv.h> inside the
> namespace declarations.
>
> To double check, I moved '#include of <fenv.h>' outside the namespace
> declarations, right after '#if defined(__HP_aCC)', ran numeric_interval
> library tests and they all passed. So, please, make this change before
> committing the header. Thanks for reviewing it!
>
> Boris

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