osdep.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617
  1. /*
  2. win32/osdep.h
  3. Copyright (c) 1990-2008 Info-ZIP. All rights reserved.
  4. See the accompanying file LICENSE, version 2007-Mar-4 or later
  5. (the contents of which are also included in zip.h) for terms of use.
  6. If, for some reason, all these files are missing, the Info-ZIP license
  7. also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html
  8. */
  9. /* Automatic setting of the common Microsoft C idenfifier MSC.
  10. * NOTE: Watcom also defines M_I*86 !
  11. */
  12. #if defined(_MSC_VER) || (defined(M_I86) && !defined(__WATCOMC__))
  13. # ifndef MSC
  14. # define MSC /* This should work for older MSC, too! */
  15. # endif
  16. #endif
  17. /* Tell Microsoft Visual C++ 2005 to leave us alone and
  18. * let us use standard C functions the way we're supposed to.
  19. */
  20. #if defined(_MSC_VER) && (_MSC_VER >= 1400)
  21. # ifndef _CRT_SECURE_NO_DEPRECATE
  22. # define _CRT_SECURE_NO_DEPRECATE
  23. # endif
  24. # ifndef _CRT_NONSTDC_NO_DEPRECATE
  25. # define _CRT_NONSTDC_NO_DEPRECATE
  26. # endif
  27. #endif
  28. #if defined(__WATCOMC__) && defined(__386__)
  29. # define WATCOMC_386
  30. #endif
  31. #if (defined(__CYGWIN32__) && !defined(__CYGWIN__))
  32. # define __CYGWIN__ /* compatibility for CygWin B19 and older */
  33. #endif
  34. /* enable multibyte character set support by default */
  35. #ifndef _MBCS
  36. # define _MBCS
  37. #endif
  38. #if defined(__CYGWIN__)
  39. # undef _MBCS
  40. #endif
  41. /* Get types and stat */
  42. #include <sys/types.h>
  43. #include <sys/stat.h>
  44. #include <io.h>
  45. #ifndef MSDOS
  46. /*
  47. * Windows 95 (and Windows NT) file systems are (to some extend)
  48. * extensions of MSDOS. Common features include for example:
  49. * FAT or (FAT like) file systems,
  50. * '\\' as directory separator in paths,
  51. * "\r\n" as record (line) terminator in text files, ...
  52. */
  53. # define MSDOS
  54. /* inherit MS-DOS file system etc. stuff */
  55. #endif
  56. #define USE_CASE_MAP
  57. #define PROCNAME(n) (action == ADD || action == UPDATE ? wild(n) : \
  58. procname(n, filter_match_case))
  59. #define BROKEN_FSEEK
  60. #ifndef __RSXNT__
  61. # define HAVE_FSEEKABLE
  62. #endif
  63. /* popen
  64. *
  65. * On Win32 must map to _popen() and _pclose()
  66. */
  67. #define popen _popen
  68. #define pclose _pclose
  69. /* WIN32_OEM
  70. *
  71. * This enables storing paths in archives on WIN32 in OEM format
  72. * which is more work but seems the standard now. It also enables
  73. * converting paths in read DOS archives from assumed OEM to ANSI.
  74. */
  75. #ifndef NO_WIN32_OEM
  76. # define WIN32_OEM
  77. #endif
  78. /* Large File Support
  79. *
  80. * If this is set it is assumed that the port
  81. * supports 64-bit file calls. The types are
  82. * defined here. Any local implementations are
  83. * in Win32.c and the prototypes for the calls are
  84. * in tailor.h. Note that a port must support
  85. * these calls fully or should not set
  86. * LARGE_FILE_SUPPORT.
  87. */
  88. /* Note also that ZOFF_T_FORMAT_SIZE_PREFIX has to be defined here
  89. or tailor.h will define defaults */
  90. /* If port has LARGE_FILE_SUPPORT then define here
  91. to make large file support automatic unless overridden */
  92. #ifndef LARGE_FILE_SUPPORT
  93. # ifndef NO_LARGE_FILE_SUPPORT
  94. /* MS C and VC */
  95. # if defined(_MSC_VER) || defined(__MINGW32__) || defined(__CYGWIN__)
  96. # define LARGE_FILE_SUPPORT
  97. # endif
  98. # if defined(__WATCOMC__)
  99. # define LARGE_FILE_SUPPORT
  100. # endif
  101. # endif
  102. #endif
  103. #ifdef LARGE_FILE_SUPPORT
  104. /* 64-bit Large File Support */
  105. /* Only types and the printf format stuff go here. Functions
  106. go in tailor.h since ANSI prototypes are required and the OF define
  107. is not defined here. */
  108. # if (defined(_MSC_VER) && (_MSC_VER >= 1100)) || defined(__MINGW32__)
  109. /* MS C and VC, MinGW32 */
  110. /* these compiler systems use the Microsoft C RTL */
  111. /* base types for file offsets and file sizes */
  112. typedef __int64 zoff_t;
  113. typedef unsigned __int64 uzoff_t;
  114. /* 64-bit stat struct */
  115. typedef struct _stati64 z_stat;
  116. /* printf format size prefix for zoff_t values */
  117. # define ZOFF_T_FORMAT_SIZE_PREFIX "I64"
  118. # elif (defined(__GNUC__) || defined(ULONG_LONG_MAX))
  119. /* GNU C */
  120. /* base types for file offsets and file sizes */
  121. typedef long long zoff_t;
  122. typedef unsigned long long uzoff_t;
  123. # ifdef __CYGWIN__
  124. /* Use Cygwin's own stat struct */
  125. typedef struct stat z_stat;
  126. # else
  127. /* 64-bit stat struct */
  128. typedef struct _stati64 z_stat;
  129. # endif
  130. /* printf format size prefix for zoff_t values */
  131. # define ZOFF_T_FORMAT_SIZE_PREFIX "ll"
  132. # elif (defined(__WATCOMC__) && (__WATCOMC__ >= 1100))
  133. /* WATCOM C */
  134. /* base types for file offsets and file sizes */
  135. typedef __int64 zoff_t;
  136. typedef unsigned __int64 uzoff_t;
  137. /* 64-bit stat struct */
  138. typedef struct _stati64 z_stat;
  139. /* printf format size prefix for zoff_t values */
  140. # define ZOFF_T_FORMAT_SIZE_PREFIX "ll"
  141. # elif (defined(__IBMC__) && (__IBMC__ >= 350))
  142. /* IBM C */
  143. /* base types for file offsets and file sizes */
  144. typedef __int64 zoff_t;
  145. typedef unsigned __int64 uzoff_t;
  146. /* 64-bit stat struct */
  147. /* printf format size prefix for zoff_t values */
  148. # define ZOFF_T_FORMAT_SIZE_PREFIX "I64"
  149. # else
  150. # undef LARGE_FILE_SUPPORT
  151. # endif
  152. #endif
  153. #if 0
  154. # ifndef ZOFF_T_FORMAT_SIZE_PREFIX
  155. /* unsupported WIN32 */
  156. /* base types for file offsets and file sizes */
  157. typedef long long zoff_t;
  158. typedef unsigned long long uzoff_t;
  159. /* 64-bit stat struct */
  160. typedef struct stat z_stat;
  161. /* printf format size prefix for zoff_t values */
  162. # define ZOFF_T_FORMAT_SIZE_PREFIX "ll"
  163. # endif
  164. #endif
  165. /* Automatically set ZIP64_SUPPORT if supported */
  166. /* MS C and VC */
  167. #if defined(_MSC_VER) || defined(__MINGW32__) || defined(__WATCOMC__)
  168. # ifdef LARGE_FILE_SUPPORT
  169. # ifndef NO_ZIP64_SUPPORT
  170. # ifndef ZIP64_SUPPORT
  171. # define ZIP64_SUPPORT
  172. # endif
  173. # endif
  174. # endif
  175. #endif
  176. #ifndef LARGE_FILE_SUPPORT
  177. /* No Large File Support */
  178. /* base type for file offsets and file sizes */
  179. typedef long zoff_t;
  180. typedef unsigned long uzoff_t;
  181. /* stat struct */
  182. typedef struct stat z_stat;
  183. /* printf format size prefix for zoff_t values */
  184. # define ZOFF_T_FORMAT_SIZE_PREFIX "l"
  185. #endif
  186. /* UNICODE */
  187. #ifdef WIN32
  188. /* assume wide character conversion functions */
  189. # ifndef UNICODE_SUPPORT
  190. # ifndef NO_UNICODE_SUPPORT
  191. # define UNICODE_SUPPORT
  192. # endif
  193. # endif
  194. #endif
  195. #if 0
  196. /* this is now generic */
  197. # ifdef UNICODE_SUPPORT
  198. /* Set up Unicode support - 9/27/05 EG */
  199. /* type of wide string characters */
  200. # define zchar wchar_t
  201. /* default char string used if a wide char can't be converted */
  202. # define zchar_default "_"
  203. # else
  204. # define zchar char
  205. # endif
  206. #endif
  207. /* File operations--use "b" for binary if allowed or fixed length 512 on VMS
  208. * use "S" for sequential access on NT to prevent the NT
  209. * file cache eating up memory with large .zip files
  210. */
  211. #define FOPR "rb"
  212. #define FOPM "r+b"
  213. #define FOPW "wbS"
  214. #if (defined(__CYGWIN__) && !defined(NO_MKTIME))
  215. # define NO_MKTIME /* Cygnus' mktime() implementation is buggy */
  216. #endif
  217. #if (!defined(NT_TZBUG_WORKAROUND) && !defined(NO_NT_TZBUG_WORKAROUND))
  218. # define NT_TZBUG_WORKAROUND
  219. #endif
  220. #if (defined(UTIL) && defined(NT_TZBUG_WORKAROUND))
  221. # undef NT_TZBUG_WORKAROUND /* the Zip utilities do not use time-stamps */
  222. #endif
  223. #if !defined(NO_EF_UT_TIME) && !defined(USE_EF_UT_TIME)
  224. # define USE_EF_UT_TIME
  225. #endif
  226. #if (!defined(NO_NTSD_EAS) && !defined(NTSD_EAS))
  227. # define NTSD_EAS
  228. #endif
  229. #if (defined(NTSD_EAS) && !defined(ZP_NEED_MEMCOMPR))
  230. # define ZP_NEED_MEMCOMPR
  231. #endif
  232. #ifdef WINDLL
  233. # ifndef NO_ASM
  234. # define NO_ASM
  235. # endif
  236. # ifndef MSWIN
  237. # define MSWIN
  238. # endif
  239. # ifndef REENTRANT
  240. # define REENTRANT
  241. # endif
  242. #endif /* WINDLL */
  243. /* Enable use of optimized x86 assembler version of longest_match() for
  244. MSDOS, WIN32 and OS2 per default. */
  245. #if !defined(NO_ASM) && !defined(ASMV)
  246. # define ASMV
  247. #endif
  248. /* Enable use of optimized x86 assembler version of crc32() for
  249. MSDOS, WIN32 and OS2 per default. */
  250. #if !defined(NO_ASM) && !defined(ASM_CRC) && !defined(NO_ASM_CRC)
  251. # define ASM_CRC
  252. #endif
  253. #if !defined(__GO32__) && !defined(__EMX__) && !defined(__CYGWIN__)
  254. # define NO_UNISTD_H
  255. #endif
  256. /* Microsoft C requires additional attributes attached to all RTL function
  257. * declarations when linking against the CRTL dll.
  258. */
  259. #ifdef MSC
  260. # ifdef IZ_IMP
  261. # undef IZ_IMP
  262. # endif
  263. # define IZ_IMP _CRTIMP
  264. #else
  265. # ifndef IZ_IMP
  266. # define IZ_IMP
  267. # endif
  268. #endif
  269. /* WIN32 runs solely on little-endian processors; enable support
  270. * for the 32-bit optimized CRC-32 C code by default.
  271. */
  272. #ifdef IZ_CRC_BE_OPTIMIZ
  273. # undef IZ_CRC_BE_OPTIMIZ
  274. #endif
  275. #if !defined(IZ_CRC_LE_OPTIMIZ) && !defined(NO_CRC_OPTIMIZ)
  276. # define IZ_CRC_LE_OPTIMIZ
  277. #endif
  278. /* the following definitions are considered as "obsolete" by Microsoft and
  279. * might be missing in some versions of <windows.h>
  280. */
  281. #ifndef AnsiToOem
  282. # define AnsiToOem CharToOemA
  283. #endif
  284. #ifndef OemToAnsi
  285. # define OemToAnsi OemToCharA
  286. #endif
  287. /* handlers for OEM <--> ANSI string conversions */
  288. #if defined(__RSXNT__) || defined(WIN32_CRT_OEM)
  289. /* RSXNT uses OEM coded strings in functions supplied by C RTL */
  290. # ifdef CRTL_CP_IS_ISO
  291. # undef CRTL_CP_IS_ISO
  292. # endif
  293. # ifndef CRTL_CP_IS_OEM
  294. # define CRTL_CP_IS_OEM
  295. # endif
  296. #else
  297. /* "real" native WIN32 compilers use ANSI coded strings in C RTL calls */
  298. # ifndef CRTL_CP_IS_ISO
  299. # define CRTL_CP_IS_ISO
  300. # endif
  301. # ifdef CRTL_CP_IS_OEM
  302. # undef CRTL_CP_IS_OEM
  303. # endif
  304. #endif
  305. #ifdef CRTL_CP_IS_ISO
  306. /* C RTL's file system support assumes ANSI coded strings */
  307. # define ISO_TO_INTERN(src, dst) {if ((src) != (dst)) strcpy((dst), (src));}
  308. # define OEM_TO_INTERN(src, dst) OemToAnsi(src, dst)
  309. # define INTERN_TO_ISO(src, dst) {if ((src) != (dst)) strcpy((dst), (src));}
  310. # define INTERN_TO_OEM(src, dst) AnsiToOem(src, dst)
  311. # define _OEM_INTERN(str1) OEM_TO_INTERN(str1, str1)
  312. # define _ISO_INTERN(str1) {;}
  313. # define _INTERN_OEM(str1) INTERN_TO_OEM(str1, str1)
  314. # define _INTERN_ISO(str1) {;}
  315. #endif /* CRTL_CP_IS_ISO */
  316. #ifdef CRTL_CP_IS_OEM
  317. /* C RTL's file system support assumes OEM coded strings */
  318. # define ISO_TO_INTERN(src, dst) AnsiToOem(src, dst)
  319. # define OEM_TO_INTERN(src, dst) {if ((src) != (dst)) strcpy((dst), (src));}
  320. # define INTERN_TO_ISO(src, dst) OemToAnsi(src, dst)
  321. # define INTERN_TO_OEM(src, dst) {if ((src) != (dst)) strcpy((dst), (src));}
  322. # define _OEM_INTERN(str1) {;}
  323. # define _ISO_INTERN(str1) ISO_TO_INTERN(str1, str1)
  324. # define _INTERN_OEM(str1) {;}
  325. # define _INTERN_ISO(str1) INTERN_TO_ISO(str1, str1)
  326. #endif /* CRTL_CP_IS_OEM */
  327. /* The following "OEM vs. ISO Zip entry names" code has been copied from UnZip.
  328. * It should be applicable to the generic Zip code. However, currently only
  329. * the Win32 port of Zip supplies the required charset conversion functions.
  330. * (The Win32 port uses conversion functions supplied by the OS.)
  331. */
  332. /* Convert filename (and file comment string) into "internal" charset.
  333. * This macro assumes that Zip entry filenames are coded in OEM (IBM DOS)
  334. * codepage when made on
  335. * -> DOS (this includes 16-bit Windows 3.1) (FS_FAT_)
  336. * -> OS/2 (FS_HPFS_)
  337. * -> Win95/WinNT with Nico Mak's WinZip (FS_NTFS_ && hostver == "5.0")
  338. * EXCEPTIONS:
  339. * PKZIP for Windows 2.5, 2.6, and 4.0 flag their entries as "FS_FAT_", but
  340. * the filename stored in the local header is coded in Windows ANSI (CP 1252
  341. * resp. ISO 8859-1 on US and western Europe locale settings).
  342. * Likewise, PKZIP for UNIX 2.51 flags its entries as "FS_FAT_", but the
  343. * filenames stored in BOTH the local and the central header are coded
  344. * in the local system's codepage (usually ANSI codings like ISO 8859-1,
  345. * but could also be UTF-8 on "modern" setups...).
  346. *
  347. * All other ports are assumed to code zip entry filenames in ISO (8859-1
  348. * on "Western" localisations).
  349. */
  350. #define FS_FAT_ 0 /* filesystem used by MS-DOS, OS/2, Win32 */
  351. #define FS_HPFS_ 6 /* filesystem used by OS/2 (and NT 3.x) */
  352. #define FS_NTFS_ 11 /* filesystem used by Windows NT */
  353. #ifndef Ext_ASCII_TO_Native
  354. # define Ext_ASCII_TO_Native(string, hostnum, hostver, isuxatt, islochdr) \
  355. if (((hostnum) == FS_FAT_ && \
  356. !(((islochdr) || (isuxatt)) && \
  357. ((hostver) == 25 || (hostver) == 26 || (hostver) == 40))) || \
  358. (hostnum) == FS_HPFS_ || \
  359. ((hostnum) == FS_NTFS_ && (hostver) == 50)) { \
  360. _OEM_INTERN((string)); \
  361. } else { \
  362. _ISO_INTERN((string)); \
  363. }
  364. #endif
  365. #if (defined(__RSXNT__) && defined(__CRTRSXNT__))
  366. # include <crtrsxnt.h>
  367. #endif
  368. #ifdef _MBCS
  369. # if (!defined(__EMX__) && !defined(__MINGW32__) && !defined(__CYGWIN__))
  370. # include <stdlib.h>
  371. # include <mbstring.h>
  372. # endif
  373. # if (defined(__MINGW32__) && !defined(MB_CUR_MAX))
  374. # ifdef __MSVCRT__
  375. IZ_IMP extern int *__p___mb_cur_max(void);
  376. # define MB_CUR_MAX (*__p___mb_cur_max())
  377. # else
  378. IZ_IMP extern int *_imp____mb_cur_max_dll;
  379. # define MB_CUR_MAX (*_imp____mb_cur_max_dll)
  380. # endif
  381. # endif
  382. # if (defined(__LCC__) && !defined(MB_CUR_MAX))
  383. IZ_IMP extern int *_imp____mb_cur_max;
  384. # define MB_CUR_MAX (*_imp____mb_cur_max)
  385. # endif
  386. #endif
  387. #ifdef __LCC__
  388. # include <time.h>
  389. # ifndef tzset
  390. # define tzset _tzset
  391. # endif
  392. # ifndef utime
  393. # define utime _utime
  394. # endif
  395. #endif
  396. #ifdef __MINGW32__
  397. IZ_IMP extern void _tzset(void); /* this is missing in <time.h> */
  398. # ifndef tzset
  399. # define tzset _tzset
  400. # endif
  401. #endif
  402. #if (defined(__RSXNT__) || defined(__EMX__)) && !defined(tzset)
  403. # define tzset _tzset
  404. #endif
  405. #ifdef W32_USE_IZ_TIMEZONE
  406. # ifdef __BORLANDC__
  407. # define tzname tzname
  408. # define IZTZ_DEFINESTDGLOBALS
  409. # endif
  410. # ifndef tzset
  411. # define tzset _tzset
  412. # endif
  413. # ifndef timezone
  414. # define timezone _timezone
  415. # endif
  416. # ifndef daylight
  417. # define daylight _daylight
  418. # endif
  419. # ifndef tzname
  420. # define tzname _tzname
  421. # endif
  422. # if (!defined(NEED__ISINDST) && !defined(__BORLANDC__))
  423. # define NEED__ISINDST
  424. # endif
  425. # ifdef IZTZ_GETLOCALETZINFO
  426. # undef IZTZ_GETLOCALETZINFO
  427. # endif
  428. # define IZTZ_GETLOCALETZINFO GetPlatformLocalTimezone
  429. #endif /* W32_USE_IZ_TIMEZONE */
  430. #ifdef MATCH
  431. # undef MATCH
  432. #endif
  433. #define MATCH dosmatch /* use DOS style wildcard matching */
  434. #ifdef UNICODE_SUPPORT
  435. # ifdef WIN32
  436. # define MATCHW dosmatchw
  437. # endif
  438. #endif
  439. #ifdef ZCRYPT_INTERNAL
  440. # ifdef WINDLL
  441. # define ZCR_SEED2 (unsigned)3141592654L /* use PI as seed pattern */
  442. # else
  443. # include <process.h> /* getpid() declaration for srand seed */
  444. # endif
  445. #endif
  446. /* Up to now, all versions of Microsoft C runtime libraries lack the support
  447. * for customized (non-US) switching rules between daylight saving time and
  448. * standard time in the TZ environment variable string.
  449. * But non-US timezone rules are correctly supported when timezone information
  450. * is read from the OS system settings in the Win32 registry.
  451. * The following work-around deletes any TZ environment setting from
  452. * the process environment. This results in a fallback of the RTL time
  453. * handling code to the (correctly interpretable) OS system settings, read
  454. * from the registry.
  455. */
  456. #ifdef USE_EF_UT_TIME
  457. # if (defined(__WATCOMC__) || defined(__CYGWIN__) || \
  458. defined(W32_USE_IZ_TIMEZONE))
  459. # define iz_w32_prepareTZenv()
  460. # else
  461. # define iz_w32_prepareTZenv() putenv("TZ=")
  462. # endif
  463. #endif
  464. /* This patch of stat() is useful for at least three compilers. It is */
  465. /* difficult to take a stat() of a root directory under Windows95, so */
  466. /* zstat_zipwin32() detects that case and fills in suitable values. */
  467. #ifndef __RSXNT__
  468. # ifndef W32_STATROOT_FIX
  469. # define W32_STATROOT_FIX
  470. # endif
  471. #endif /* !__RSXNT__ */
  472. #if (defined(NT_TZBUG_WORKAROUND) || defined(W32_STATROOT_FIX))
  473. # define W32_STAT_BANDAID
  474. # ifdef LARGE_FILE_SUPPORT /* E. Gordon 9/12/03 */
  475. int zstat_zipwin32(const char *path, z_stat *buf);
  476. # else
  477. int zstat_zipwin32(const char *path, struct stat *buf);
  478. # endif
  479. # ifdef UNICODE_SUPPORT
  480. # ifdef LARGE_FILE_SUPPORT
  481. int zstat_zipwin32w(const wchar_t *pathw, struct _stati64 *buf);
  482. # else
  483. int zstat_zipwin32w(const wchar_t *pathw, struct _stat *buf);
  484. # endif
  485. # endif
  486. # ifdef SSTAT
  487. # undef SSTAT
  488. # endif
  489. # define SSTAT zstat_zipwin32
  490. # ifdef UNICODE_SUPPORT
  491. # define SSTATW zstat_zipwin32w
  492. # endif
  493. #endif /* NT_TZBUG_WORKAROUND || W32_STATROOT_FIX */
  494. int getch_win32(void);
  495. #ifdef __GNUC__
  496. # define IZ_PACKED __attribute__((packed))
  497. #else
  498. # define IZ_PACKED
  499. #endif
  500. /* for some (all ?) versions of IBM C Set/2 and IBM C Set++ */
  501. #ifndef S_IFMT
  502. # define S_IFMT 0xF000
  503. #endif /* !S_IFMT */
  504. #ifdef __WATCOMC__
  505. # include <stdio.h> /* PATH_MAX is defined here */
  506. # define NO_MKTEMP
  507. /* Get asm routines to link properly without using "__cdecl": */
  508. # ifdef __386__
  509. # ifdef ASMV
  510. # pragma aux match_init "_*" parm caller [] modify []
  511. # pragma aux longest_match "_*" parm caller [] value [eax] \
  512. modify [eax ecx edx]
  513. # endif
  514. # if defined(ASM_CRC) && !defined(USE_ZLIB)
  515. # pragma aux crc32 "_*" parm caller [] value [eax] modify [eax]
  516. # pragma aux get_crc_table "_*" parm caller [] value [eax] \
  517. modify [eax ecx edx]
  518. # endif /* ASM_CRC && !USE_ZLIB */
  519. # endif /* __386__ */
  520. /* Watcom C (like the other Win32 C compiler systems) does not support
  521. * symlinks on Win32, but defines the S_IFLNK symbol nevertheless.
  522. * However, the existence of this symbol is used as "symlinks supported"
  523. * indicator in the generic Zip code (see tailor.h). So, for a simple
  524. * work-around, this symbol is undefined here. */
  525. # ifdef S_IFLNK
  526. # undef S_IFLNK
  527. # endif
  528. # ifdef UNICODE_SUPPORT
  529. /* Watcom C does not supply wide-char definitions in the "standard"
  530. * headers like MSC; so we have to pull in a wchar-specific header.
  531. */
  532. # include <wchar.h>
  533. # endif
  534. #endif /* __WATCOMC__ */