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) Guido Draheim, use under copyleft (LGPL,MPL)
17 #define _ZZIP_CONF_H 1
19 #if !defined ZZIP_OMIT_CONFIG_H
20 # if defined _MSC_VER || defined __BORLANDC__ || defined __WATCOMC__
21 # include <zzip/_msvc.h>
22 # elif defined ZZIP_1_H
24 # elif defined ZZIP_2_H
26 # elif defined ZZIP_3_H
28 # elif defined ZZIP_4_H
30 # elif defined ZZIP_5_H
32 # else /* autoconf generated */
33 # include <zzip/_config.h>
37 /* especially win32 platforms do not declare off_t so far - see zzip-msvc.h */
40 #define _zzip_off_t ZZIP_off_t
42 #define _zzip_off_t off_t
48 #define _zzip_off64_t ZZIP_off64_t
50 #define _zzip_off64_t off64_t
54 /* currently unused, all current zziplib-users do have ansi-C94 compilers. */
57 #define _zzip_const ZZIP_const
59 #define _zzip_const const
64 #define _zzip_inline ZZIP_inline
66 #define _zzip_inline inline
69 #ifndef _zzip_restrict
71 #define _zzip_restrict ZZIP_restrict
73 #define _zzip_restrict restrict
76 #if defined __linux__ && __GNUC__+0 >= 4
77 #define zzip__new__ __attribute__((malloc))
78 #elif defined __linux__ && __GNUC__+0 >= 3 && __GNUC_MINOR_+0 >= 3
79 #define zzip__new__ __attribute__((malloc))
86 #define _zzip_size_t ZZIP_size_t
88 #define _zzip_size_t size_t
93 #define _zzip_ssize_t ZZIP_ssize_t
95 #define _zzip_ssize_t ssize_t
100 #define _zzip___int64 ZZIP___int64
102 #define _zzip___int64 long long
106 /* whether this library shall use a 64bit off_t largefile variant in 64on32: */
107 /* (some exported names must be renamed to avoid bad calls after linking) */
108 #if defined ZZIP_LARGEFILE_SENSITIVE
109 # if _FILE_OFFSET_BITS+0 == 64
110 # define ZZIP_LARGEFILE_RENAME
111 # elif defined _LARGE_FILES /* used on older AIX to get at 64bit off_t */
112 # define ZZIP_LARGEFILE_RENAME
113 # elif defined _ZZIP_LARGEFILE /* or simply use this one for zzip64 runs */
114 # define ZZIP_LARGEFILE_RENAME
118 /* if the environment did not setup these for 64bit off_t largefile... */
119 #ifdef ZZIP_LARGEFILE_RENAME
120 # ifndef _FILE_OFFSET_BITS
121 # ifdef ZZIP__FILE_OFFSET_BITS /* == 64 */
122 # define _FILE_OFFSET_BITS ZZIP__FILE_OFFSET_BITS
125 # ifndef _LARGE_FILES
126 # ifdef ZZIP__LARGE_FILES /* == 1 */
127 # define _LARGE_FILES ZZIP__LARGE_FILES
130 # ifndef _LARGEFILE_SOURCE
131 # ifdef ZZIP__LARGEFILE_SOURCE /* == 1 */
132 # define _LARGEFILE_SOURCE ZZIP__LARGEFILE_SOURCE
139 /* mingw32msvc errno : would be in winsock.h */
141 #define EREMOTE ESPIPE
148 #define ELOOP ENOEXEC
152 #if defined __WATCOMC__
154 #define _zzip_inline static
157 #if defined _MSC_VER || defined __WATCOMC__
164 # define _zzip_lseek _lseek
167 # define _zzip_read _read
170 # define _zzip_write _write
174 # define _zzip_stat _stat
177 # endif /* !__STDC__ */
181 #if defined _MSC_VER || defined __WATCOMC__
183 # define strcasecmp _stricmp
188 # define _zzip_lseek lseek
192 # define _zzip_read read
196 # define _zzip_write write
201 # define _zzip_stat stat
206 #if defined ZZIP_EXPORTS || defined ZZIPLIB_EXPORTS
211 /* based on zconf.h : */
212 /* compile with -DZZIP_DLL for Windows DLL support */
214 # if defined _WINDOWS || defined WINDOWS || defined _WIN32
215 /*# include <windows.h>*/
217 # if !defined _zzip_export && defined _MSC_VER && (defined WIN32 || defined _WIN32)
218 # define _zzip_export __declspec(dllexport) /*WINAPI*/
220 # if !defined _zzip_export && defined __BORLANDC__
221 # if __BORLANDC__ >= 0x0500 && defined WIN32
222 # include <windows.h>
223 # define _zzip_export __declspec(dllexport) /*WINAPI*/
225 # if defined _Windows && defined __DLL__
226 # define _zzip_export _export
230 # if !defined _zzip_export && defined __GNUC__
231 # if defined __declspec
232 # define _zzip_export extern __declspec(dllexport)
234 # define _zzip_export extern
237 # if !defined _zzip_export && defined __BEOS__
238 # define _zzip_export extern __declspec(export)
240 # if !defined _zzip_export && defined __WATCOMC__
241 # define _zzip_export extern __declspec(dllexport)
242 # define ZEXPORT __syscall
243 # define ZEXTERN extern
247 #if !defined _zzip_export
248 # if defined __GNUC__ /* || !defined HAVE_LIBZZIP */
249 # define _zzip_export extern
250 # elif defined __declspec || (defined _MSC_VER && defined ZZIP_DLL)
251 # define _zzip_export extern __declspec(dllimport)
253 # define _zzip_export extern