summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/glsl/builtin_functions.cpp4
-rw-r--r--src/glsl/s_expression.cpp4
2 files changed, 4 insertions, 4 deletions
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 <limits>
+#include <math.h>
#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<float>::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 <assert.h>
-#include <limits>
#include <stdio.h>
+#include <math.h>
#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<float>::infinity());
+ expr = new(ctx) s_float(INFINITY);
} else {
// Check if the atom is a number.
char *float_end = NULL;