2 * Here we postprocess autoconf generated prefix-config.h entries.
3 * This is generally for things like "off_t" which is left undefined
4 * in plain config.h if the host system does already have it but we do
5 * need the prefix variant - so we add here a #define _zzip_off_t off_t
7 * This file is supposed to only carry '#define's.
8 * See <zzip/types.h> for definitions that might be seen by the compiler.
11 * Guido Draheim <guidod@gmx.de>
13 * Copyright (c) 2001,2002,2003,2004 Guido Draheim
14 * All rights reserved,
15 * use under the restrictions of the
16 * Lesser GNU General Public License
17 * or alternatively the restrictions
18 * of the Mozilla Public License 1.1
22 #define _ZZIP_CONF_H 1
24 #if !defined ZZIP_OMIT_CONFIG_H
25 # if defined _MSC_VER || defined __BORLANDC__ || defined __WATCOMC__
26 # include <zzip/_msvc.h>
27 # elif defined ZZIP_1_H
29 # elif defined ZZIP_2_H
31 # elif defined ZZIP_3_H
33 # elif defined ZZIP_4_H
35 # elif defined ZZIP_5_H
37 # else /* autoconf generated */
38 # include <zzip/_config.h>
42 /* especially win32 platforms do not declare off_t so far - see zzip-msvc.h */
45 #define _zzip_off_t ZZIP_off_t
47 #define _zzip_off_t off_t
53 #define _zzip_off64_t ZZIP_off64_t
55 #define _zzip_off64_t off64_t
59 /* currently unused, all current zziplib-users do have ansi-C94 compilers. */
62 #define _zzip_const ZZIP_const
64 #define _zzip_const const
69 #define _zzip_inline ZZIP_inline
71 #define _zzip_inline inline
74 #ifndef _zzip_restrict
76 #define _zzip_restrict ZZIP_restrict
78 #define _zzip_restrict restrict
81 #if defined __linux__ && __GNUC__+0 >= 4
82 #define zzip__new__ __attribute__((malloc))
83 #elif defined __linux__ && __GNUC__+0 >= 3 && __GNUC_MINOR__+0 >= 3
84 #define zzip__new__ __attribute__((malloc))
91 #define _zzip_size_t ZZIP_size_t
93 #define _zzip_size_t size_t
98 #define _zzip_ssize_t ZZIP_ssize_t
100 #define _zzip_ssize_t ssize_t
103 #ifndef _zzip___int64
105 #define _zzip___int64 ZZIP___int64
107 #define _zzip___int64 long long
111 /* whether this library shall use a 64bit off_t largefile variant in 64on32: */
112 /* (some exported names must be renamed to avoid bad calls after linking) */
113 #if defined ZZIP_LARGEFILE_SENSITIVE
114 # if _FILE_OFFSET_BITS+0 == 64
115 # define ZZIP_LARGEFILE_RENAME
116 # elif defined _LARGE_FILES /* used on older AIX to get at 64bit off_t */
117 # define ZZIP_LARGEFILE_RENAME
118 # elif defined _ZZIP_LARGEFILE /* or simply use this one for zzip64 runs */
119 # define ZZIP_LARGEFILE_RENAME
123 /* if the environment did not setup these for 64bit off_t largefile... */
124 #ifdef ZZIP_LARGEFILE_RENAME
125 # ifndef _FILE_OFFSET_BITS
126 # ifdef ZZIP__FILE_OFFSET_BITS /* == 64 */
127 # define _FILE_OFFSET_BITS ZZIP__FILE_OFFSET_BITS
130 # ifndef _LARGE_FILES
131 # ifdef ZZIP__LARGE_FILES /* == 1 */
132 # define _LARGE_FILES ZZIP__LARGE_FILES
135 # ifndef _LARGEFILE_SOURCE
136 # ifdef ZZIP__LARGEFILE_SOURCE /* == 1 */
137 # define _LARGEFILE_SOURCE ZZIP__LARGEFILE_SOURCE
146 /* mingw32msvc errno : would be in winsock.h */
148 #define EREMOTE ESPIPE
155 #define ELOOP ENOEXEC
159 #endif /* ZZIP_DISABLED */
161 #if defined __WATCOMC__
163 #define _zzip_inline static
166 #if defined _MSC_VER || defined __WATCOMC__
173 # define _zzip_lseek _lseek
176 # define _zzip_read _read
179 # define _zzip_write _write
183 # define _zzip_stat _stat
186 # endif /* !__STDC__ */
190 #if defined _MSC_VER || defined __WATCOMC__
192 # define strcasecmp _stricmp
197 # define _zzip_lseek lseek
201 # define _zzip_read read
205 # define _zzip_write write
210 # define _zzip_stat stat
215 #if defined ZZIP_EXPORTS || defined ZZIPLIB_EXPORTS
220 /* based on zconf.h : */
221 /* compile with -DZZIP_DLL for Windows DLL support */
223 # if defined _WINDOWS || defined WINDOWS || defined _WIN32
224 /*# include <windows.h>*/
226 # if !defined _zzip_export && defined _MSC_VER && (defined WIN32 || defined _WIN32)
227 # define _zzip_export __declspec(dllexport) /*WINAPI*/
229 # if !defined _zzip_export && defined __BORLANDC__
230 # if __BORLANDC__ >= 0x0500 && defined WIN32
231 # include <windows.h>
232 # define _zzip_export __declspec(dllexport) /*WINAPI*/
234 # if defined _Windows && defined __DLL__
235 # define _zzip_export _export
239 # if !defined _zzip_export && defined __GNUC__
240 # if defined __declspec
241 # define _zzip_export extern __declspec(dllexport)
243 # define _zzip_export extern
246 # if !defined _zzip_export && defined __BEOS__
247 # define _zzip_export extern __declspec(export)
249 # if !defined _zzip_export && defined __WATCOMC__
250 # define _zzip_export extern __declspec(dllexport)
251 # define ZEXPORT __syscall
252 # define ZEXTERN extern
256 #if !defined _zzip_export
257 # if defined __GNUC__ /* || !defined HAVE_LIBZZIP */
258 # define _zzip_export extern
259 # elif defined __declspec || (defined _MSC_VER && defined ZZIP_DLL)
260 # define _zzip_export extern __declspec(dllimport)
262 # define _zzip_export extern