summaryrefslogtreecommitdiff
path: root/Zend/zend_long.h
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_long.h')
-rw-r--r--Zend/zend_long.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/Zend/zend_long.h b/Zend/zend_long.h
index ac270c719b..0fcc3116ae 100644
--- a/Zend/zend_long.h
+++ b/Zend/zend_long.h
@@ -52,8 +52,8 @@ typedef int32_t zend_off_t;
# define ZEND_LONG_MAX INT32_MAX
# define ZEND_LONG_MIN INT32_MIN
# define ZEND_ULONG_MAX UINT32_MAX
-# define Z_L(i) i
-# define Z_UL(i) i
+# define Z_L(i) INT32_C(i)
+# define Z_UL(i) UINT32_C(i)
# define SIZEOF_ZEND_LONG 4
#endif
@@ -110,6 +110,17 @@ typedef int32_t zend_off_t;
# define ZEND_ABS abs
#endif
+#if SIZEOF_ZEND_LONG == 4
+# define MAX_LENGTH_OF_LONG 11
+# define LONG_MIN_DIGITS "2147483648"
+#elif SIZEOF_ZEND_LONG == 8
+# define MAX_LENGTH_OF_LONG 20
+# define LONG_MIN_DIGITS "9223372036854775808"
+#else
+# error "Unknown SIZEOF_ZEND_LONG"
+#endif
+
+static const char long_min_digits[] = LONG_MIN_DIGITS;
#endif /* ZEND_LONG_H */