[haiku-bugs] Re: [Haiku] #6230: math.h uses an evil definition for HUGE_VALF

  • From: "bonefish" <trac@xxxxxxxxxxxx>
  • Date: Fri, 05 Nov 2010 09:16:09 -0000

#6230: math.h uses an evil definition for HUGE_VALF
---------------------------+---------------------------------------------
  Reporter:  TechnoMancer  |        Owner:  nobody
      Type:  bug           |       Status:  new
  Priority:  normal        |    Milestone:  R1
 Component:  System/POSIX  |      Version:  R1/Development
Resolution:                |     Keywords:  HUGE_VALF __builtin_huge_valf
Blocked By:                |  Has a Patch:  1
  Platform:  All           |     Blocking:
---------------------------+---------------------------------------------

Comment (by bonefish):

 Replying to [comment:4 TechnoMancer]:
 > I have provided a patch for this, this will cause gcc4 to also use the
 builtins instead of that horrible old method, I also added the one for
 HUGE_VALL for gcc4 and clang.  If people dislike the repeated #if....
 #else....#endif blocks I can change it to be one #if and the defs then an
 #else and the old section.  Please review the patch.

 A single `#if __GNUC__ >= 4` block would indeed be nicer. The comment on
 the following seems to be off:
 {{{
 44      /* TODO: define HUGE_VALL for long doubles for gcc2 */
 45      #if __GNUC__ >= 4
 46      #   define HUGE_VALL        __builtin_huge_vall()
 47      #endif
 }}}
 Otherwise the patch looks OK.

 BTW, any clue why, unlike for the other macros, there's a check for a pre-
 existing definition of `HUGE_VAL`?

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/6230#comment:5>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: