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 590bdec..9d8b482 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 95177c4..0021d95 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 82ac323..6034952 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