summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAlexey Kopytov <Alexey.Kopytov@sun.com>2009-03-25 15:48:29 +0300
committerAlexey Kopytov <Alexey.Kopytov@sun.com>2009-03-25 15:48:29 +0300
commitc4eba1edc174262cd76fdfed84b1a1bdb5b35df0 (patch)
tree14174933b6b2a2738ea715fb4d699627731962c5 /include
parent0bab3f2ffdb57889d7f4b98fc78d77c12e821f06 (diff)
parentbbe24f03f2288049b39359ad52b0cccc1b762b44 (diff)
downloadmariadb-git-c4eba1edc174262cd76fdfed84b1a1bdb5b35df0.tar.gz
Manual merge.
Diffstat (limited to 'include')
-rw-r--r--include/my_global.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/include/my_global.h b/include/my_global.h
index ad86aeb749f..803315e3dcd 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -905,10 +905,20 @@ 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
-#define my_isinf(X) (!isfinite(X) && !isnan(X))
+/* 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
/* Define missing math constants. */