Make getndelim2 compile on mingw.
[pspp] / lib / getndelim2.c
index 46721e751b7779315790f14760964ee679052eb3..453fd3835f43a4ed1aa0c5867a4bb8138155b698 100644 (file)
 #include <limits.h>
 #include <stdint.h>
 
+/* Mingw doesn't have SSIZE_MAX.  */
+#ifndef SSIZE_MAX
+# define SSIZE_MAX ((((ssize_t)1 << (sizeof (ssize_t) * CHAR_BIT - 2)) - 1) * 2 + 1)
+#endif
+
 /* The maximum value that getndelim2 can return without suffering from
    overflow problems, either internally (because of pointer
    subtraction overflow) or due to the API (because of ssize_t).  */