diff options
author | José Fonseca <jfonseca@vmware.com> | 2014-11-07 12:37:05 +0000 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2014-11-08 10:21:29 +0000 |
commit | 4fbad1b5b5cc99f4118b5840d758e21f9dd5829d (patch) | |
tree | 2f5dba887a3b021fe8b242aa0c82aae2db85fc0b | |
parent | 8d8db05e252d9e87f83e6dd37c0ce5296471939b (diff) |
tests/util: INFINITY/NAN are defined on MSVC 2013.
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
-rw-r--r-- | tests/shaders/shader_runner.c | 8 | ||||
-rwxr-xr-x | tests/util/piglit-util.h | 7 |
2 files changed, 2 insertions, 13 deletions
diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c index 1f93216c1..628ef4481 100644 --- a/tests/shaders/shader_runner.c +++ b/tests/shaders/shader_runner.c @@ -1147,10 +1147,6 @@ static double strtod_inf(const char *nptr, char **endptr) { #if defined(_MSC_VER) - /* Define our own infinty value here */ - const unsigned inf_u = 0x7f800000; - const float inf = *((float *) &inf_u); - /* skip spaces and tabs */ while (*nptr == ' ' || *nptr == '\t') nptr++; @@ -1158,12 +1154,12 @@ strtod_inf(const char *nptr, char **endptr) if (nptr[0] == 'i' && nptr[1] == 'n' && nptr[2] == 'f') { /* +infinity */ *endptr = (char *) (nptr + 3); - return inf; + return INFINITY; } else if (nptr[0] == '-' && nptr[1] == 'i' && nptr[2] == 'n' && nptr[3] == 'f') { /* -infinity */ *endptr = (char *) (nptr + 4); - return -inf; + return -INFINITY; } /* fall-through */ #endif diff --git a/tests/util/piglit-util.h b/tests/util/piglit-util.h index cc3b42112..1c1d27e8b 100755 --- a/tests/util/piglit-util.h +++ b/tests/util/piglit-util.h @@ -94,13 +94,6 @@ int asprintf(char **strp, const char *fmt, ...) PRINTFLIKE(2, 3); #endif #endif -// Trick from http://tdistler.com/2011/03/24/how-to-define-nan-not-a-number-on-windows -#ifndef INFINITY -# define INFINITY (FLT_MAX + FLT_MAX) -#endif -#ifndef NAN -# define NAN (INFINITY - INFINITY) -#endif enum piglit_result { PIGLIT_PASS, |