math.h: Convert HUGE_VALL to constant, from const-qualified var
authorStathis Kamperis <beket@dragonflybsd.org>
Wed, 30 Jun 2010 20:56:06 +0000 (23:56 +0300)
committerStathis Kamperis <beket@dragonflybsd.org>
Thu, 1 Jul 2010 08:06:08 +0000 (11:06 +0300)
commitd1c42bb23082b2a1c10016ee94c3f7cdb678a2e8
tree346001e3fdd893a1d9eb59c14c475062add63bfc
parentae14c9db8e2fcad505fc56fbb1c091229828d8f1
math.h: Convert HUGE_VALL to constant, from const-qualified var

Define HUGE_VALL via a compiler builtin. If the compiler doesn't
support it, we just fallback to previous situation. Both gcc and
clang play well with it.

This patch allows us to:
1. use HUGE_VALL as initializer element for objects with static
   storage duration
2. not worry about the format of long double (e.g., 96bit vs 128bit)
3. not worry about things like endianness

Briefly-discussed-with: corecode@, swildner@, but put the blame on me
if I broke something for you.

Special-thanks-to: swildner@ for checking code with clang.

P.S. HUGE_VAL{,F} already do the right thing.
include/math.h