summaryrefslogtreecommitdiffstats
path: root/lib/msun/src/math_private.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/msun/src/math_private.h')
-rw-r--r--lib/msun/src/math_private.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/msun/src/math_private.h b/lib/msun/src/math_private.h
index 2db3c02..15ef4fb 100644
--- a/lib/msun/src/math_private.h
+++ b/lib/msun/src/math_private.h
@@ -154,6 +154,22 @@ do { \
(d) = sf_u.value; \
} while (0)
+#ifdef FLT_EVAL_METHOD
+/*
+ * Attempt to get strict C99 semantics for assignment with non-C99 compilers.
+ */
+#if FLT_EVAL_METHOD == 0 || __GNUC__ == 0
+#define STRICT_ASSIGN(type, lval, rval) ((lval) = (rval))
+#else
+#define STRICT_ASSIGN(type, lval, rval) do { \
+ volatile type __lval; \
+ \
+ __lval = (rval); \
+ (lval) = __lval; \
+} while (0)
+#endif
+#endif
+
/*
* Common routine to process the arguments to nan(), nanf(), and nanl().
*/
OpenPOWER on IntegriCloud