internal.h: fake ISO C99 INFINITY and NAN if not defined
authorDaniel Kochmański <daniel@turtleware.eu>
Fri, 4 Sep 2015 18:58:31 +0000 (20:58 +0200)
committerDaniel Kochmański <daniel@turtleware.eu>
Fri, 4 Sep 2015 19:32:09 +0000 (21:32 +0200)
Signed-off-by: Daniel Kochmański <daniel@turtleware.eu>
src/h/internal.h

index dba0d8f..0b24cf1 100755 (executable)
@@ -604,6 +604,18 @@ extern cl_object si_wait_for_all_processes _ECL_ARGS((cl_narg narg, ...));
 # define ldexpf(x,y) ldexp((float)x,y)
 #endif
 
+/*
+ * Fake INFINITY and NAN defined in ISO C99 (portably)
+ */
+
+#ifndef INFINITY
+# define INFINITY (1.0/0.0)
+#endif
+
+#ifndef NAN
+# define NAN (0.0/0.0)
+#endif
+
 #ifdef __cplusplus
 }
 #endif