diff options
author | Vinson Lee <[email protected]> | 2012-07-29 15:12:05 -0700 |
---|---|---|
committer | Vinson Lee <[email protected]> | 2012-07-30 23:27:19 -0700 |
commit | 2faa2b4f7e4d5a230d5e2ec55bea06eab8dd8fba (patch) | |
tree | 70b4c6a8b2c03d6e5eda9a2a0b6eaafd8e2f2d74 /src/gallium | |
parent | 3d0b54c7c6021becb3cae9245fc8f88a0f0f2be9 (diff) |
gallium/util: Use GCC built-in functions for NaN and infinity.
This patch fixes this build failure with Intel Compiler.
src/gallium/auxiliary/util/u_format_tests.c(903): error: floating-point operation result is out of range
{PIPE_FORMAT_R16_FLOAT, PACKED_1x16(0xffff), PACKED_1x16(0x7c01), UNPACKED_1x1( NAN, 0.0, 0.0, 1.0)},
Signed-off-by: Vinson Lee <[email protected]>
Reviewed-by: José Fonseca <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/auxiliary/util/u_format_tests.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_format_tests.c b/src/gallium/auxiliary/util/u_format_tests.c index 457fda6c899..d34860886e1 100644 --- a/src/gallium/auxiliary/util/u_format_tests.c +++ b/src/gallium/auxiliary/util/u_format_tests.c @@ -66,8 +66,13 @@ {{ 0, 0, 0, 0}, { 0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}} +#ifdef __GNUC__ +#define NAN __builtin_nan("") +#define INF __builtin_inf() +#else #define NAN (0.0 / 0.0) #define INF (1.0 / 0.0) +#endif /** * Test cases. |