summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavi Arnaut <Davi.Arnaut@Sun.COM>2009-05-05 20:41:58 +0200
committerDavi Arnaut <Davi.Arnaut@Sun.COM>2009-05-05 20:41:58 +0200
commit6bee08c61dbb89837edc04de8e49fed411f17770 (patch)
tree119a0053bfa574d7efee096e23cb467bdfdcea52 /include
parente9f38910daa8feb7e916773a43f8bd50c6ffc2ef (diff)
parent75da023da6aea082d30d100e95052bb56738d25b (diff)
downloadmariadb-git-6bee08c61dbb89837edc04de8e49fed411f17770.tar.gz
Merge from 5.0-pe-stage into main.
Diffstat (limited to 'include')
-rw-r--r--include/my_global.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/include/my_global.h b/include/my_global.h
index 06d5b0f94b4..31bcb771c4d 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -797,9 +797,19 @@ typedef SOCKET_SIZE_TYPE size_socket;
#endif
#ifdef HAVE_ISINF
-/* isinf() can be used in both C and C++ code */
-#define my_isinf(X) isinf(X)
+/* Check if C compiler is affected by GCC bug #39228 */
+#if !defined(__cplusplus) && defined(HAVE_BROKEN_ISINF)
+/* Force store/reload of the argument to/from a 64-bit double */
+static inline double my_isinf(double x)
+{
+ volatile double t= x;
+ return isinf(t);
+}
#else
+/* System-provided isinf() is available and safe to use */
+#define my_isinf(X) isinf(X)
+#endif
+#else /* !HAVE_ISINF */
#define my_isinf(X) (!finite(X) && !isnan(X))
#endif