From 6557362411667cddb44f2117d49e81f5f77d6ff9 Mon Sep 17 00:00:00 2001 From: Ralf Corsepius Date: Fri, 18 Mar 2011 10:11:44 +0000 Subject: Import from zlib-1.2.5 --- cpukit/zlib/zconf.h | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'cpukit/zlib/zconf.h') diff --git a/cpukit/zlib/zconf.h b/cpukit/zlib/zconf.h index 58880245c1..02ce56c431 100644 --- a/cpukit/zlib/zconf.h +++ b/cpukit/zlib/zconf.h @@ -315,10 +315,6 @@ # endif #endif -#ifdef HAVE_VISIBILITY_PRAGMA -# define ZEXTERN __attribute__((visibility ("default"))) extern -#endif - #ifndef ZEXTERN # define ZEXTERN extern #endif @@ -364,8 +360,21 @@ typedef uLong FAR uLongf; # define Z_HAVE_UNISTD_H #endif -#ifdef Z_HAVE_UNISTD_H +#ifdef STDC # include /* for off_t */ +#endif + +/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and + * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even + * though the former does not conform to the LFS document), but considering + * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as + * equivalently requesting no 64-bit operations + */ +#if -_LARGEFILE64_SOURCE - -1 == 1 +# undef _LARGEFILE64_SOURCE +#endif + +#if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE) # include /* for SEEK_* and off_t */ # ifdef VMS # include /* for off_t */ @@ -375,19 +384,22 @@ typedef uLong FAR uLongf; # endif #endif -#ifdef _LARGEFILE64_SOURCE -# include -#endif - #ifndef SEEK_SET # define SEEK_SET 0 /* Seek from beginning of file. */ # define SEEK_CUR 1 /* Seek from current position. */ # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ #endif + #ifndef z_off_t # define z_off_t long #endif +#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0 +# define z_off64_t off64_t +#else +# define z_off64_t z_off_t +#endif + #if defined(__OS400__) # define NO_vsnprintf #endif -- cgit v1.2.3