From 3bee67337d0491f55654cf8e926592365e5a8502 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 6 May 1998 05:05:00 +0000 Subject: [PATCH] fix up the int64 handling a little. It should work on a few more systems now (tested on OSF1) --- configure.in | 4 ++-- io.c | 2 +- rsync.h | 7 ++++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/configure.in b/configure.in index 590bdec1..9d8b4827 100644 --- a/configure.in +++ b/configure.in @@ -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 -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 95177c4e..0021d956 100644 --- 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 82ac3235..6034952c 100644 --- a/rsync.h +++ b/rsync.h @@ -193,10 +193,15 @@ #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 -- 2.34.1