Make getndelim2 compile on mingw.
authorBruno Haible <bruno@clisp.org>
Fri, 20 Oct 2006 19:59:49 +0000 (19:59 +0000)
committerBruno Haible <bruno@clisp.org>
Fri, 20 Oct 2006 19:59:49 +0000 (19:59 +0000)
ChangeLog
lib/getndelim2.c

index 1a54b47..e5ffa57 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2006-10-19  Bruno Haible  <bruno@clisp.org>
 
+       * lib/getndelim2.c (SSIZE_MAX): Provide fallback definition. Needed
+       for mingw.
+
+2006-10-19  Bruno Haible  <bruno@clisp.org>
+
        * lib/openat-priv.h (EOPNOTSUPP): Provide fallback definition.
        Needed for mingw.
 
index 46721e7..453fd38 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).  */