From: Matt Turner Date: Tue, 13 Jan 2015 06:35:53 +0000 (-0800) Subject: glsl: Use INFINITY instead of std::numeric_limits::infinity(). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=871f1080d0f7b7444458de40b67de7938c220922;p=mesa.git glsl: Use INFINITY instead of std::numeric_limits::infinity(). Reviewed-by: Jose Fonseca --- diff --git a/src/glsl/builtin_functions.cpp b/src/glsl/builtin_functions.cpp index c6075722c91..524b8d6e8b9 100644 --- a/src/glsl/builtin_functions.cpp +++ b/src/glsl/builtin_functions.cpp @@ -60,7 +60,7 @@ #include "ir_builder.h" #include "glsl_parser_extras.h" #include "program/prog_instruction.h" -#include +#include #define M_PIf ((float) M_PI) #define M_PI_2f ((float) M_PI_2) @@ -3215,7 +3215,7 @@ builtin_builder::_isinf(builtin_available_predicate avail, const glsl_type *type ir_constant_data infinities; for (int i = 0; i < type->vector_elements; i++) { - infinities.f[i] = std::numeric_limits::infinity(); + infinities.f[i] = INFINITY; } body.emit(ret(equal(abs(x), imm(type, infinities)))); diff --git a/src/glsl/s_expression.cpp b/src/glsl/s_expression.cpp index 7eaa491e291..f82e155a6b6 100644 --- a/src/glsl/s_expression.cpp +++ b/src/glsl/s_expression.cpp @@ -23,8 +23,8 @@ */ #include -#include #include +#include #include "s_expression.h" s_symbol::s_symbol(const char *str, size_t n) @@ -70,7 +70,7 @@ read_atom(void *ctx, const char *&src, char *&symbol_buffer) // requires strtof to parse '+INF' as +Infinity, but we still support some // non-C99-compliant compilers (e.g. MSVC). if (n == 4 && strncmp(src, "+INF", 4) == 0) { - expr = new(ctx) s_float(std::numeric_limits::infinity()); + expr = new(ctx) s_float(INFINITY); } else { // Check if the atom is a number. char *float_end = NULL;