]> granicus.if.org Git - zziplib/blob - zzip/conf.h
remove msvc6 warnings about difference of signedness of pointer target types
[zziplib] / zzip / conf.h
1 /*\r
2  * Author: \r
3  *      Guido Draheim <guidod@gmx.de>\r
4  *\r
5  *      Copyright (c) 2001,2002,2003 Guido Draheim\r
6  *          All rights reserved,\r
7  *          use under the restrictions of the\r
8  *          Lesser GNU General Public License\r
9  *          or alternatively the restrictions \r
10  *          of the Mozilla Public License 1.1\r
11  */\r
12 \r
13 #ifndef _ZZIP_CONF_H\r
14 #define _ZZIP_CONF_H 1\r
15 \r
16 #if !defined ZZIP_OMIT_CONFIG_H\r
17 # if defined _MSC_VER || defined __BORLANDC__ || defined __WATCOMC__\r
18 # include <zzip/_msvc.h>\r
19 # elif defined ZZIP_1_H\r
20 # include "zzip-1.h"\r
21 # elif defined ZZIP_2_H\r
22 # include "zzip-2.h"\r
23 # elif defined ZZIP_3_H\r
24 # include "zzip-3.h"\r
25 # elif defined ZZIP_4_H\r
26 # include "zzip-4.h"\r
27 # elif defined ZZIP_5_H\r
28 # include "zzip-5.h"\r
29 # else /* autoconf generated */\r
30 # include <zzip/_config.h>\r
31 # endif\r
32 #endif\r
33 \r
34 /* especially win32 platforms do not declare off_t so far - see zzip-msvc.h */\r
35 #ifndef _zzip_off_t\r
36 #ifdef   ZZIP_off_t\r
37 #define _zzip_off_t ZZIP_off_t\r
38 #else\r
39 #define _zzip_off_t off_t\r
40 #endif\r
41 #endif\r
42 \r
43 /* currently unused, all current zziplib-users do have ansi-C94 compilers. */\r
44 #ifndef _zzip_const\r
45 #ifdef   ZZIP_const\r
46 #define _zzip_const ZZIP_const\r
47 #else\r
48 #define _zzip_const const\r
49 #endif\r
50 #endif\r
51 #ifndef _zzip_inline\r
52 #ifdef   ZZIP_inline\r
53 #define _zzip_inline ZZIP_inline\r
54 #else\r
55 #define _zzip_inline inline\r
56 #endif\r
57 #endif\r
58 #ifndef _zzip_size_t\r
59 #ifdef   ZZIP_size_t\r
60 #define _zzip_size_t ZZIP_size_t\r
61 #else\r
62 #define _zzip_size_t size_t\r
63 #endif\r
64 #endif\r
65 #ifndef _zzip_ssize_t\r
66 #ifdef   ZZIP_ssize_t\r
67 #define _zzip_ssize_t ZZIP_ssize_t\r
68 #else\r
69 #define _zzip_ssize_t ssize_t\r
70 #endif\r
71 #endif\r
72 \r
73 /* whether this library shall use a 64bit off_t largefile variant in 64on32: */\r
74 /* (some exported names must be renamed to avoid bad calls after linking) */\r
75 #if defined ZZIP_LARGEFILE_SENSITIVE \r
76 # if _FILE_OFFSET_BITS+0 == 64\r
77 # define  ZZIP_LARGEFILE_RENAME\r
78 # elif defined  _LARGE_FILES    /* used on older AIX to get at 64bit off_t */\r
79 # define  ZZIP_LARGEFILE_RENAME\r
80 # elif defined  _ZZIP_LARGEFILE /* or simply use this one for zzip64 runs */\r
81 # define  ZZIP_LARGEFILE_RENAME\r
82 # endif\r
83 #endif\r
84 \r
85 /* if the environment did not setup these for 64bit off_t largefile... */\r
86 #ifdef   ZZIP_LARGEFILE_RENAME\r
87 # ifndef      _FILE_OFFSET_BITS\r
88 #  ifdef ZZIP__FILE_OFFSET_BITS /* == 64 */\r
89 #  define     _FILE_OFFSET_BITS ZZIP__FILE_OFFSET_BITS\r
90 #  endif\r
91 # endif\r
92 # ifndef      _LARGE_FILES\r
93 #  ifdef ZZIP__LARGE_FILES /* == 1 */\r
94 #  define     _LARGE_FILES ZZIP__LARGE_FILES\r
95 #  endif\r
96 # endif\r
97 # ifndef      _LARGEFILE_SOURCE\r
98 #  ifdef ZZIP__LARGEFILE_SOURCE /* == 1 */\r
99 #  define     _LARGEFILE_SOURCE ZZIP__LARGEFILE_SOURCE\r
100 #  endif\r
101 # endif\r
102 #endif\r
103 \r
104 #include <errno.h>\r
105 \r
106 /* mingw32msvc errno : would be in winsock.h */\r
107 #ifndef EREMOTE\r
108 #define EREMOTE ESPIPE\r
109 #endif\r
110 \r
111 #ifndef ELOOP\r
112 #if   defined EILSEQ\r
113 #define ELOOP EILSEQ\r
114 #else\r
115 #define ELOOP ENOEXEC\r
116 #endif\r
117 #endif\r
118 \r
119 #if defined __WATCOMC__\r
120 #undef  _zzip_inline\r
121 #define _zzip_inline static\r
122 #endif\r
123 \r
124 #if defined _MSC_VER || defined __WATCOMC__\r
125 #include <io.h>\r
126 #endif\r
127 \r
128 #ifdef _MSC_VER\r
129 # if !__STDC__\r
130 #  ifndef _zzip_lseek\r
131 #  define _zzip_lseek _lseek\r
132 #  endif\r
133 #  ifndef _zzip_read\r
134 #  define _zzip_read _read\r
135 #  endif\r
136 #  ifndef _zzip_write\r
137 #  define _zzip_write _write\r
138 #  endif\r
139 /*\r
140 #  ifndef _zzip_stat\r
141 #  define _zzip_stat _stat\r
142 #  endif\r
143 */\r
144 # endif /* !__STDC__ */\r
145 #endif\r
146   /*MSVC*/\r
147 \r
148 #if defined _MSC_VER || defined __WATCOMC__\r
149 #  ifndef strcasecmp\r
150 #  define strcasecmp _stricmp\r
151 #  endif\r
152 #endif\r
153 \r
154 #  ifndef _zzip_lseek\r
155 #  define _zzip_lseek lseek\r
156 #  endif\r
157 \r
158 #  ifndef _zzip_read\r
159 #  define _zzip_read  read\r
160 #  endif\r
161 \r
162 #  ifndef _zzip_write\r
163 #  define _zzip_write  write\r
164 #  endif\r
165 \r
166 /*\r
167 #  ifndef _zzip_stat\r
168 #  define _zzip_stat  stat\r
169 #  endif\r
170 */\r
171 \r
172 \r
173 #if !defined __GNUC__ && !defined __attribute__\r
174 #define __attribute__(X) \r
175 #endif\r
176 \r
177 #if defined ZZIP_EXPORTS || defined ZZIPLIB_EXPORTS\r
178 # undef ZZIP_DLL\r
179 #define ZZIP_DLL 1\r
180 #endif\r
181 \r
182 /* based on zconf.h : */\r
183 /* compile with -DZZIP_DLL for Windows DLL support */\r
184 #if defined ZZIP_DLL\r
185 #  if defined _WINDOWS || defined WINDOWS || defined _WIN32\r
186 /*#  include <windows.h>*/\r
187 #  endif\r
188 #  if !defined _zzip_export && defined _MSC_VER && (defined WIN32 || defined _WIN32)\r
189 #    define _zzip_export __declspec(dllexport) /*WINAPI*/\r
190 #  endif\r
191 #  if !defined _zzip_export && defined __BORLANDC__\r
192 #    if __BORLANDC__ >= 0x0500 && defined WIN32\r
193 #    include <windows.h>\r
194 #    define _zzip_export __declspec(dllexport) /*WINAPI*/\r
195 #    else\r
196 #      if defined _Windows && defined __DLL__\r
197 #      define _zzip_export _export\r
198 #      endif\r
199 #    endif\r
200 #  endif\r
201 #  if !defined _zzip_export && defined __GNUC__\r
202 #    if defined __declspec\r
203 #      define _zzip_export extern __declspec(dllexport)\r
204 #    else\r
205 #      define _zzip_export extern\r
206 #    endif\r
207 #  endif\r
208 #  if !defined _zzip_export && defined __BEOS__\r
209 #    define _zzip_export extern __declspec(export)\r
210 #  endif\r
211 #  if !defined _zzip_export && defined __WATCOMC__\r
212 #    define _zzip_export extern __declspec(dllexport)\r
213 #    define ZEXPORT __syscall\r
214 #    define ZEXTERN extern\r
215 #  endif\r
216 #endif\r
217 \r
218 #if !defined _zzip_export\r
219 #  if defined __GNUC__ /* || !defined HAVE_LIBZZIP */\r
220 #  define _zzip_export extern\r
221 #  elif defined __declspec || (defined _MSC_VER && defined ZZIP_DLL)\r
222 #  define _zzip_export extern __declspec(dllimport)\r
223 #  else\r
224 #  define _zzip_export extern\r
225 #  endif\r
226 #endif\r
227 \r
228 #endif\r
229 \r
230 \r