cURL / Mailing Lists / curl-library / Single Mail

curl-library

LONG_MAX patch

From: Gisle Vanem <gvanem_at_broadpark.no>
Date: Tue, 13 Jan 2004 20:54:08 +0100

LONG_MAX is used in main.c, but <limits.h> isn't included anywhere
(except for djgpp. Where is this xmalloc stuffimplemented btw?).

I assume HAVE_LIMITS_H is set by Configure, but Windows need this:

diff -u3 -w CVS-latest/src/config-win32.h src/config-win32.h
--- CVS-latest/src/config-win32.h Fri Sep 07 10:53:21 2001
+++ src/config-win32.h Mon Jan 12 16:15:48 2004
@@ -8,6 +8,9 @@
 /* Define if you have the <io.h> header file. */
 #define HAVE_IO_H 1

+/* Define if you have the <limits.h> header file */
+#define HAVE_LIMITS_H 1
+
 /* Define if you have the strdup function. */
 #define HAVE_STRDUP 1

diff -u3 -w CVS-latest/src/main.c src/main.c
--- CVS-latest/src/main.c Tue Jan 13 09:35:58 2004
+++ src/main.c Tue Jan 13 20:28:31 2004
@@ -88,6 +88,10 @@

 #endif

+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
 #ifdef HAVE_SYS_POLL_H
 #include <sys/poll.h>
 #endif

-----------------

Wouldn't hurt to patch for djgpp too (so we can drop the extra
<limits.h> in main.c):

diff -u3 -w CVS-latest/src/setup.h src/setup.h
--- CVS-latest/src/setup.h Tue Jan 13 09:35:58 2004
+++ src/setup.h Tue Jan 13 20:43:22 2004
@@ -92,6 +92,7 @@
 #ifdef word
 #undef word
 #endif
+#define HAVE_LIMITS_H
 #define DIR_CHAR "/"
 #define DOT_CHAR "_"
 #else

------------

--gv

-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
Received on 2004-01-13