# We have a prototype for telldir.
ccflags="${ccflags} -pipe -fno-common -DHAS_TELLDIR_PROTOTYPE";
+# At least OS X 10.0.3:
+#
+# # define INT32_MIN -2147483648
+# int main () {
+# double a = INT32_MIN;
+# printf ("INT32_MIN=%g\n", a);
+# return 0;
+# }
+# will output:
+# INT32_MIN=2.14748e+09
+# Note that the INT32_MIN has become positive.
+# INT32_MIN is set in /usr/include/stdint.h by:
+# #define INT32_MIN -2147483648
+# which seems to break the gcc. Defining INT32_MIN as (-2147483647-1)
+# seems to work. INT64_MIN seems to be similarly broken.
+# -- Nicholas Clark, Ken Williams, and Edward Moy
+#
+ccflags="${ccflags} -DINT32_MIN_BROKEN -DINT64_MIN_BROKEN"
+
# For Errno.
cppflags='-traditional-cpp';
typedef IVTYPE IV;
typedef UVTYPE UV;
+#ifdef INT32_MIN_BROKEN
+# undef INT32_MIN
+# define INT32_MIN (-2147483647-1)
+#endif
+
+#ifdef INT64_MIN_BROKEN
+# undef INT64_MIN
+# define INT64_MIN (-9223372036854775807LL-1)
+#endif
+
#if defined(USE_64_BIT_INT) && defined(HAS_QUAD)
# if QUADKIND == QUAD_IS_INT64_T && defined(INT64_MAX)
# define IV_MAX INT64_MAX