summaryrefslogtreecommitdiff
path: root/Zend/zend_multiply.h
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_multiply.h')
-rw-r--r--Zend/zend_multiply.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/Zend/zend_multiply.h b/Zend/zend_multiply.h
index b84480b57..ad4adc88d 100644
--- a/Zend/zend_multiply.h
+++ b/Zend/zend_multiply.h
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_multiply.h,v 1.10.2.1.2.4 2008/12/31 11:17:33 sebastian Exp $ */
+/* $Id: zend_multiply.h,v 1.10.2.1.2.2.2.3 2008/12/31 11:15:32 sebastian Exp $ */
#if defined(__i386__) && defined(__GNUC__)
@@ -31,6 +31,19 @@
else (lval) = __tmpvar; \
} while (0)
+#elif SIZEOF_LONG == 4 && defined(HAVE_ZEND_LONG64)
+
+#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
+ zend_long64 __result = (zend_long64) (a) * (zend_long64) (b); \
+ if (__result > LONG_MAX || __result < LONG_MIN) { \
+ (dval) = (double) __result; \
+ (usedval) = 1; \
+ } else { \
+ (lval) = (long) __result; \
+ (usedval) = 0; \
+ } \
+} while (0)
+
#else
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \