]> sjero.net Git - wget/commitdiff
[svn] Large file fixes for Borland C, published in
authorhniksic <devnull@localhost>
Sat, 26 Feb 2005 00:23:24 +0000 (16:23 -0800)
committerhniksic <devnull@localhost>
Sat, 26 Feb 2005 00:23:24 +0000 (16:23 -0800)
<87u0o0cgr1.fsf@xemacs.org>.

src/ChangeLog
src/mswindows.c
src/mswindows.h
src/utils.c
windows/Makefile.src
windows/Makefile.src.bor
windows/Makefile.top.bor

index 921f2d4c2033e30ad5ee2418227040ab5dd2e323..c80da5a516ca1d58a7a8dc89cd8fe0e4e52fc0be 100644 (file)
@@ -1,3 +1,17 @@
+2005-02-26  Hrvoje Niksic  <hniksic@xemacs.org>
+
+       * utils.c: Use the nnnI64 syntax for __int64 constants under all
+       Windows compilers.
+       (SPRINTF_WGINT): Use "%I64" under all Windows compilers.
+
+       * mswindows.h (WGINT_MAX): Use the nnnI64 syntax for
+       __int64 constants under all Windows compilers.
+       (struct_stat): Use `struct stati64' under Borland C.
+       (fstat): Don't redefine to _fstati64 under Borland.
+
+       * mswindows.c: Define str_to_int64 under Borland C as well as
+       under (older) Visual C.
+
 2005-02-25  Hrvoje Niksic  <hniksic@xemacs.org>
 
        * ftp.c (getftp): Initialize err to suppress compiler warning.
index 8c3e84a59c0f9e9feb7824798c172a3be9bd0de4..ca1f46a8e541abece471743897b4de5855419e04 100644 (file)
@@ -86,7 +86,7 @@ xsleep (double seconds)
 #endif /* not HAVE_USLEEP */
 }
 
-#if defined(_MSC_VER) && _MSC_VER < 1300
+#if defined(__BORLANDC__) || (defined(_MSC_VER) && _MSC_VER < 1300)
 
 static inline int
 char_value (char c, int base)
@@ -195,7 +195,7 @@ str_to_int64 (const char *nptr, char **endptr, int base)
   return result;
 }
 
-#else  /* !defined(_MSC_VER) || _MSC_VER >= 1300 */
+#else  /* !defined(__BORLANDC__) && (!defined(_MSC_VER) || _MSC_VER >= 1300) */
 
 __int64
 str_to_int64 (const char *nptr, char **endptr, int base)
@@ -207,7 +207,7 @@ str_to_int64 (const char *nptr, char **endptr, int base)
 #endif
 }
 
-#endif /* !defined(_MSC_VER) || _MSC_VER >= 1300 */
+#endif /* !defined(__BORLANDC__) && (!defined(_MSC_VER) || _MSC_VER >= 1300) */
 
 void
 windows_main_junk (int *argc, char **argv, char **exec_name)
index ced740cdbcf5344cbd5f1ec9e30cb831d2d83b43..0b795af4146e1b0bd18160aef7b0b8c1f2974109 100644 (file)
@@ -83,12 +83,7 @@ so, delete this exception statement from your version.  */
 /* Define a wgint type under Windows. */
 typedef __int64 wgint;
 #define SIZEOF_WGINT 8
-
-#if defined(_MSC_VER) || defined (__WATCOMC__)
-# define WGINT_MAX 9223372036854775807I64
-#else
-# define WGINT_MAX 9223372036854775807LL
-#endif
+#define WGINT_MAX 9223372036854775807I64
 
 #define str_to_wgint str_to_int64
 __int64 str_to_int64 (const char *, char **, int);
@@ -99,13 +94,22 @@ __int64 str_to_int64 (const char *, char **, int);
 /* Transparently support large files, in spirit similar to the POSIX
    LFS API.  */
 #define stat(fname, buf) _stati64 (fname, buf)
-#define fstat(fd, buf) _fstati64 (fd, buf)
-#define struct_stat struct _stati64
+
+#ifndef __BORLANDC__
+# define fstat(fd, buf) _fstati64 (fd, buf)
+#endif
+
+#if defined(_MSC_VER)
+# define struct_stat struct _stati64
+#elif defined(__BORLANDC__)
+# define struct_stat struct stati64
+#else
+# define struct_stat struct stat
+#endif
 
 #define PATH_SEPARATOR '\\'
 
 #ifdef HAVE_ISATTY
-/* Microsoft VC supports _isatty; Borland?  */
 #ifdef _MSC_VER
 # define isatty _isatty
 #endif
index 7259d019197c8081700d5a3c342f683f41ea065d..2589a233234098f390492585dc3b999930133fe4 100644 (file)
@@ -1263,9 +1263,8 @@ numdigit (wgint number)
 #  define C100000000000000000 100000000000000000LL
 #  define C1000000000000000000 1000000000000000000LL
 # else
-#  if defined(_MSC_VER) || defined(__WATCOM__)
-/* Otherwise, if __int64 is available (under Windows), use __int64
-   constants. */
+#  if defined(WINDOWS)
+/* Use __int64 constants under Windows. */
 #   define C10000000000 10000000000I64
 #   define C100000000000 100000000000I64
 #   define C1000000000000 1000000000000I64
@@ -1287,7 +1286,7 @@ numdigit (wgint number)
 # if SIZEOF_LONG_LONG >= SIZEOF_WGINT
 #   define SPRINTF_WGINT(buf, n) sprintf(buf, "%lld", (long long) (n))
 # else
-#  ifdef _MSC_VER
+#  ifdef WINDOWS
 #   define SPRINTF_WGINT(buf, n) sprintf(buf, "%I64", (__int64) (n))
 #  endif
 # endif
index cde223d0d2acb215e6b3773dc35005999b05b135..c4946eb0a1d7d05aa1e6bff1db6bd63bb9a56c37 100644 (file)
@@ -72,13 +72,13 @@ SRC = cmpt.c safe-ctype.c convert.c connect.c host.c http.c netrc.c \
       ftp-basic.c ftp.c ftp-ls.c ftp-opie.c getopt.c hash.c \
       html-parse.c html-url.c progress.c retr.c recur.c res.c url.c cookies.c \
       init.c utils.c main.c version.c xmalloc.c mswindows.c \
-      gen-md5.c gnu-md5.c log.c string_t.c $(SSLSRC)
+      gen-md5.c gnu-md5.c log.c $(SSLSRC)
 
 OBJ = cmpt$o safe-ctype$o convert$o connect$o host$o http$o netrc$o \
       ftp-basic$o ftp$o ftp-ls$o ftp-opie$o getopt$o hash$o \
       html-parse$o html-url$o progress$o retr$o recur$o res$o url$o cookies$o \
       init$o utils$o main$o version$o xmalloc$o mswindows$o \
-      gen-md5$o gnu-md5$o log$o string_t$o $(SSLOBJ)
+      gen-md5$o gnu-md5$o log$o $(SSLOBJ)
 
 .SUFFIXES: .c .obj
 
index 32ff46cf4db6a9df211bddc8342ede0eab31c46c..e01c087cbac76e10287d9b615d6e66d1d48a6c91 100644 (file)
@@ -14,7 +14,7 @@ OBJS=cmpt.obj connect.obj convert.obj ftp.obj ftp-basic.obj  \
       http.obj init.obj log.obj main.obj gnu-md5.obj netrc.obj  \
       safe-ctype.obj hash.obj progress.obj gen-md5.obj cookies.obj \
       recur.obj res.obj retr.obj url.obj utils.obj version.obj xmalloc.obj \
-      mswindows.obj string_t.obj
+      mswindows.obj
 
 LIBDIR=$(MAKEDIR)\..\lib
 
@@ -48,7 +48,6 @@ recur.obj+
 res.obj+
 retr.obj+
 safe-ctype.obj+
-string_t.obj+
 url.obj+
 utils.obj+
 version.obj+
index e264f6c70f0173e6f946eb03afe7c46aa18b8957..e4554813505bf74185725167f6179e8a4fc9e24c 100644 (file)
@@ -38,7 +38,7 @@ all: Makefile $(SUBDIRS)
 
 $(SUBDIRS): 
        cd $@
-       $(MAKE)
+       $(MAKEDIR)\$(MAKE)
        cd ..
 
 # install everything