]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
fix up the int64 handling a little. It should work on a few more
authorAndrew Tridgell <tridge@samba.org>
Wed, 6 May 1998 05:05:00 +0000 (05:05 +0000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 6 May 1998 05:05:00 +0000 (05:05 +0000)
systems now (tested on OSF1)

configure.in
io.c
rsync.h

index 590bdec10f76b0aee9b7a0722d61af216dacc7d4..9d8b48279306e8a7a71a1ba805d906833c9d0074 100644 (file)
@@ -50,9 +50,9 @@ main() { exit(fnmatch("*.o", "x.o", 0) == 0? 0: 1); }],
 echo yes;AC_DEFINE(HAVE_FNMATCH), 
 echo no)
 
-echo $ac_n "checking for long long... $ac_c"
+echo $ac_n "checking for long long ... $ac_c"
 AC_TRY_RUN([#include <stdio.h>
-main() { long long x = 1000000000000; char b[20]; sprintf(b,"%lld", x); exit(strcmp("1000000000000", b) == 0? 0: 1); }],
+main() { long long x = 1000000; char b[20]; x *= x; sprintf(b,"%lld", x); exit(strcmp("1000000000000", b) == 0? 0: 1); }],
 echo yes;AC_DEFINE(HAVE_LONGLONG), 
 echo no)
 
diff --git a/io.c b/io.c
index 95177c4eb2c8ac6bc9a7f37e217a816c444796e4..0021d956fcbb89dc576153c240184c67f5280095 100644 (file)
--- a/io.c
+++ b/io.c
@@ -187,7 +187,7 @@ int64 read_longint(int f)
 
        if (ret != -1) return ret;
 
-#ifndef HAVE_LONGLONG
+#ifdef NO_INT64
        fprintf(FERROR,"Integer overflow - attempted 64 bit offset\n");
        exit_cleanup(1);
 #else
diff --git a/rsync.h b/rsync.h
index 82ac3235c979c2192587614f4cd04b2686b5b1cc..6034952c632a8a6060391b249b36d96c904ced41 100644 (file)
--- a/rsync.h
+++ b/rsync.h
 #define uint32 unsigned int32
 #endif
 
-#ifdef HAVE_LONGLONG
+#if (SIZEOF_LONG == 8) 
+#define int64 long
+#elif (SIZEOF_INT == 8) 
+#define int64 int
+#elif HAVE_LONGLONG
 #define int64 long long
 #else
 #define int64 off_t
+#define NO_INT64
 #endif
 
 #ifndef MIN