/src/zziplib/zzip/conf.h

https://bitbucket.org/cabalistic/ogredeps/ · C++ Header · 264 lines · 209 code · 26 blank · 29 comment · 42 complexity · d337cb542690352f27ba0b1df87e0f38 MD5 · raw file

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