From: Adam Dickmeiss Date: Wed, 10 May 2006 14:13:45 +0000 (+0000) Subject: Check size of off_t and adjust printf format accordingly. X-Git-Tag: before.bug.529~120 X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=commitdiff_plain;h=3042550d9340f8f9e3058702240e2cd376aa33fa Check size of off_t and adjust printf format accordingly. --- diff --git a/configure.ac b/configure.ac index 93ac45d..9d3f17e 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ dnl Zebra, Index Data ApS, 1995-2006 -dnl $Id: configure.ac,v 1.4 2006-04-24 13:23:15 marc Exp $ +dnl $Id: configure.ac,v 1.5 2006-05-10 14:13:45 adam Exp $ dnl AC_PREREQ(2.59) AC_INIT([idzebra],[1.4.0],[adam@indexdata.dk]) @@ -265,6 +265,9 @@ if test "$bits" = "64"; then else AC_MSG_RESULT(no) fi +AC_CHECK_SIZEOF([off_t]) +AC_CHECK_SIZEOF([long long]) +AC_CHECK_SIZEOF([long]) dnl ------ Modules AC_SUBST(SHARED_MODULE_LA) SHARED_MODULE_LA="" diff --git a/index/extract.c b/index/extract.c index 06b285a..e06b9ae 100644 --- a/index/extract.c +++ b/index/extract.c @@ -1,4 +1,4 @@ -/* $Id: extract.c,v 1.211 2006-05-10 13:54:01 adam Exp $ +/* $Id: extract.c,v 1.212 2006-05-10 14:13:45 adam Exp $ Copyright (C) 1995-2006 Index Data ApS @@ -36,12 +36,19 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #include -#if _FILE_OFFSET_BITS == 64 -#define PRINTF_OFF_T "%Ld" +#ifdef WIN32 +#define PRINTF_OFF_T "%I64d" +#else +/* !WIN32 */ +#if SIZEOF_OFF_T == SIZEOF_LONG_LONG +#define PRINTF_OFF_T "%lld" #else #define PRINTF_OFF_T "%ld" #endif +#endif + + #define USE_SHELLSORT 0 #if USE_SHELLSORT