w32cfg.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574
  1. /*
  2. Copyright (c) 1990-2009 Info-ZIP. All rights reserved.
  3. See the accompanying file LICENSE, version 2009-Jan-02 or later
  4. (the contents of which are also included in unzip.h) for terms of use.
  5. If, for some reason, all these files are missing, the Info-ZIP license
  6. also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html
  7. */
  8. /*---------------------------------------------------------------------------
  9. Win32 specific configuration section:
  10. ---------------------------------------------------------------------------*/
  11. #ifndef __w32cfg_h
  12. #define __w32cfg_h
  13. #ifdef __CYGWIN__
  14. /* We treat the file system underneath the Cygwin Unix emulator environment
  15. * as "native VFAT/NTFS" and use the WIN32 API for its special attributes...
  16. */
  17. # ifdef UNIX
  18. # undef UNIX
  19. # endif
  20. #endif
  21. #if (defined(_MSC_VER) && !defined(MSC))
  22. # define MSC
  23. #endif
  24. /* enable multibyte character set support by default */
  25. #if (!defined(_MBCS) && !defined(NO_MBCS))
  26. # define _MBCS
  27. #endif
  28. #if (defined(_MBCS) && defined(NO_MBCS))
  29. # undef _MBCS
  30. #endif
  31. #if (defined(__CYGWIN__) && defined(_MBCS))
  32. # undef _MBCS /* Cygwin RTL lacks support for __mb_cur_max */
  33. #endif
  34. #if (defined(__DJGPP__) && !defined(__EMX__) && defined(_MBCS))
  35. # undef _MBCS /* __mb_cur_max missing for RSXNTdj 1.6 beta */
  36. #endif
  37. #include <sys/types.h> /* off_t, time_t, dev_t, ... */
  38. #include <sys/stat.h>
  39. #include <io.h> /* read(), open(), etc. */
  40. #include <time.h>
  41. #if ((defined(__RSXNT__) || defined(__EMX__)) && !defined(tzset))
  42. # define tzset _tzset
  43. #endif
  44. #if (defined(__LCC__) && !defined(tzset))
  45. # define tzset _tzset
  46. #endif
  47. #ifdef __MINGW32__
  48. extern void _tzset(void); /* this is missing in <time.h> */
  49. # ifndef tzset
  50. # define tzset _tzset
  51. # endif
  52. #endif
  53. #ifdef W32_USE_IZ_TIMEZONE
  54. # ifdef __BORLANDC__
  55. # define tzname tzname
  56. # define IZTZ_DEFINESTDGLOBALS
  57. # endif
  58. # ifdef __WATCOMC__
  59. # define IZTZ_DEFINESTDGLOBALS
  60. # endif
  61. # ifndef tzset
  62. # define tzset _tzset
  63. # endif
  64. # ifndef timezone
  65. # define timezone _timezone
  66. # endif
  67. # ifndef daylight
  68. # define daylight _daylight
  69. # endif
  70. # ifndef tzname
  71. # define tzname _tzname
  72. # endif
  73. # if (!defined(NEED__ISINDST) && !defined(__BORLANDC__))
  74. # define NEED__ISINDST
  75. # endif
  76. # ifdef IZTZ_GETLOCALETZINFO
  77. # undef IZTZ_GETLOCALETZINFO
  78. # endif
  79. # define IZTZ_GETLOCALETZINFO GetPlatformLocalTimezone
  80. #endif /* W32_USE_IZ_TIMEZONE */
  81. #include <memory.h>
  82. #if (!defined(__RSXNT__) && !defined(__CYGWIN__))
  83. # include <direct.h> /* mkdir() */
  84. #endif
  85. #include <fcntl.h>
  86. #ifdef __CYGWIN__
  87. # include <unistd.h>
  88. extern int setmode(int, int); /* this is missing in <fcntl.h> */
  89. #endif
  90. #if (defined(MSC) || defined(__WATCOMC__) || defined(__MINGW32__))
  91. # include <sys/utime.h>
  92. #else
  93. # include <utime.h>
  94. #endif
  95. #define GOT_UTIMBUF
  96. #ifdef _MBCS
  97. # if (!defined(__EMX__) && !defined(__DJGPP__) && !defined(__CYGWIN__))
  98. # if (!defined(__MINGW32__) || defined(__MSVCRT__))
  99. # include <stdlib.h>
  100. # include <mbstring.h>
  101. /* for MSC (and compatible compilers), use routines supplied by RTL */
  102. # define CLEN(ptr) _mbclen((const uch *)(ptr))
  103. # define PREINCSTR(ptr) (ptr = (char *)_mbsinc((const uch *)(ptr)))
  104. # define MBSCHR(str, c) (char *)_mbschr((const uch *)(str), (c))
  105. # define MBSRCHR(str, c) (char *)_mbsrchr((const uch *)(str), (c))
  106. # endif
  107. # endif
  108. # if (defined(__MINGW32__) && !defined(MB_CUR_MAX))
  109. # ifdef __MSVCRT__
  110. extern int *__p___mb_cur_max(void);
  111. # define MB_CUR_MAX (*__p___mb_cur_max())
  112. # else
  113. extern int *_imp____mb_cur_max_dll;
  114. # define MB_CUR_MAX (*_imp____mb_cur_max_dll)
  115. # endif
  116. # endif
  117. # if (defined(__LCC__) && !defined(MB_CUR_MAX))
  118. extern int *_imp____mb_cur_max;
  119. # define MB_CUR_MAX (*_imp____mb_cur_max)
  120. # endif
  121. # if (defined(__DJGPP__) && !defined(__EMX__) && !defined(MB_CUR_MAX))
  122. extern int *_imp____mb_cur_max;
  123. # define MB_CUR_MAX (*_imp____mb_cur_max)
  124. # endif
  125. #endif
  126. /* for UnZip, the "basic" part of the win32 api is sufficient */
  127. #ifndef WIN32_LEAN_AND_MEAN
  128. # define WIN32_LEAN_AND_MEAN
  129. #endif
  130. #if defined(__FILEIO_C)
  131. # ifndef __CYGWIN__
  132. # include <conio.h>
  133. # endif
  134. # include <windows.h>
  135. # ifdef __RSXNT__
  136. # include "../win32/rsxntwin.h"
  137. # endif
  138. # ifndef TIME_ZONE_ID_INVALID
  139. # define TIME_ZONE_ID_INVALID (DWORD)0xFFFFFFFFL
  140. # endif
  141. #endif
  142. #if (defined(__ENVARGS_C) || defined(__EXTRACT_C) || defined(__UNZIP_C) || \
  143. defined(ZCRYPT_INTERNAL))
  144. # include <windows.h>
  145. # ifdef __RSXNT__
  146. # include "../win32/rsxntwin.h"
  147. # endif
  148. # ifndef TIME_ZONE_ID_INVALID
  149. # define TIME_ZONE_ID_INVALID (DWORD)0xFFFFFFFFL
  150. # endif
  151. #endif
  152. #ifndef Cdecl
  153. # define Cdecl __cdecl
  154. #endif
  155. /* the following definitions are considered as "obsolete" by Microsoft and
  156. * might be missing in some versions of <windows.h>
  157. */
  158. #ifndef AnsiToOem
  159. # define AnsiToOem CharToOemA
  160. #endif
  161. #ifndef OemToAnsi
  162. # define OemToAnsi OemToCharA
  163. #endif
  164. #define DIR_END '\\' /* OS uses '\\' as directory separator */
  165. #define DIR_END2 '/' /* also check for '/' (RTL may convert) */
  166. #ifdef DATE_FORMAT
  167. # undef DATE_FORMAT
  168. #endif
  169. #define DATE_FORMAT dateformat()
  170. #ifdef DATE_SEPCHAR
  171. # undef DATE_SEPCHAR
  172. #endif
  173. #define DATE_SEPCHAR dateseparator()
  174. #define lenEOL 2
  175. #define PutNativeEOL {*q++ = native(CR); *q++ = native(LF);}
  176. #if (defined(__RSXNT__) && !defined(HAVE_MKTIME))
  177. # define HAVE_MKTIME /* use mktime() in time conversion routines */
  178. #endif
  179. #if (defined(MSC) && !defined(HAVE_MKTIME))
  180. # define HAVE_MKTIME /* use mktime() in time conversion routines */
  181. #endif
  182. #if (defined(__CYGWIN__) && defined(HAVE_MKTIME))
  183. # undef HAVE_MKTIME /* Cygnus' mktime() implementation is buggy */
  184. #endif
  185. #if (defined(W32_USE_IZ_TIMEZONE) && !defined(HAVE_MKTIME))
  186. # define HAVE_MKTIME /* use mktime() in time conversion routines */
  187. #endif
  188. #if (!defined(NO_EF_UT_TIME) && !defined(USE_EF_UT_TIME))
  189. # define USE_EF_UT_TIME
  190. #endif
  191. #if (!defined(NO_DIR_ATTRIB) && !defined(SET_DIR_ATTRIB))
  192. # define SET_DIR_ATTRIB
  193. #endif
  194. #if (!defined(NOTIMESTAMP) && !defined(TIMESTAMP))
  195. # define TIMESTAMP
  196. #endif
  197. #if (!defined(NO_NTSD_EAS) && !defined(NTSD_EAS))
  198. # define NTSD_EAS /* enable NTSD support unless explicitly suppressed */
  199. #endif
  200. #if (defined(NTSD_EAS) && !defined(RESTORE_ACL))
  201. # define RESTORE_ACL /* "restore ACLs" only needed when NTSD_EAS active */
  202. #endif
  203. #if (!defined(NO_UNICODE_SUPPORT) && !defined(UNICODE_SUPPORT))
  204. # define UNICODE_SUPPORT /* enable UTF-8 filename support by default */
  205. #endif
  206. #if (defined(UNICODE_SUPPORT) && !defined(UNICODE_WCHAR))
  207. # define UNICODE_WCHAR /* wchar_t is UTF-16 encoded on WIN32 */
  208. #endif
  209. #ifdef UTF8_MAYBE_NATIVE
  210. # undef UTF8_MAYBE_NATIVE /* UTF-8 cannot be system charset on WIN32 */
  211. #endif
  212. /* The following compiler systems provide or use a runtime library with a
  213. * locale-aware isprint() implementation. For these systems, the "enhanced"
  214. * unprintable charcode detection in fnfilter() gets enabled.
  215. */
  216. #if (!defined(HAVE_WORKING_ISPRINT) && !defined(NO_WORKING_ISPRINT))
  217. # if defined(MSC) || defined(__BORLANDC__)
  218. # define HAVE_WORKING_ISPRINT
  219. # endif
  220. # if defined(__MINGW32__) && defined(__MSVCRT__)
  221. # define HAVE_WORKING_ISPRINT
  222. # endif
  223. #endif
  224. /* WIN32 runs solely on little-endian processors; enable support
  225. * for the 32-bit optimized CRC-32 C code by default.
  226. */
  227. #ifdef IZ_CRC_BE_OPTIMIZ
  228. # undef IZ_CRC_BE_OPTIMIZ
  229. #endif
  230. #if !defined(IZ_CRC_LE_OPTIMIZ) && !defined(NO_CRC_OPTIMIZ)
  231. # define IZ_CRC_LE_OPTIMIZ
  232. #endif
  233. /* handlers for OEM <--> ANSI string conversions */
  234. #ifdef __RSXNT__
  235. /* RSXNT uses OEM coded strings in functions supplied by C RTL */
  236. # ifdef CRTL_CP_IS_ISO
  237. # undef CRTL_CP_IS_ISO
  238. # endif
  239. # ifndef CRTL_CP_IS_OEM
  240. # define CRTL_CP_IS_OEM
  241. # endif
  242. #else
  243. /* "real" native WIN32 compilers use ANSI coded strings in C RTL calls */
  244. # ifndef CRTL_CP_IS_ISO
  245. # define CRTL_CP_IS_ISO
  246. # endif
  247. # ifdef CRTL_CP_IS_OEM
  248. # undef CRTL_CP_IS_OEM
  249. # endif
  250. #endif
  251. #ifdef CRTL_CP_IS_ISO
  252. /* C RTL's file system support assumes ANSI coded strings */
  253. # define ISO_TO_INTERN(src, dst) {if ((src) != (dst)) strcpy((dst), (src));}
  254. # define OEM_TO_INTERN(src, dst) OemToAnsi(src, dst)
  255. # define INTERN_TO_ISO(src, dst) {if ((src) != (dst)) strcpy((dst), (src));}
  256. # define INTERN_TO_OEM(src, dst) AnsiToOem(src, dst)
  257. #endif /* CRTL_CP_IS_ISO */
  258. #ifdef CRTL_CP_IS_OEM
  259. /* C RTL's file system support assumes OEM coded strings */
  260. # define ISO_TO_INTERN(src, dst) AnsiToOem(src, dst)
  261. # define OEM_TO_INTERN(src, dst) {if ((src) != (dst)) strcpy((dst), (src));}
  262. # define INTERN_TO_ISO(src, dst) OemToAnsi(src, dst)
  263. # define INTERN_TO_OEM(src, dst) {if ((src) != (dst)) strcpy((dst), (src));}
  264. #endif /* CRTL_CP_IS_OEM */
  265. #define _OEM_INTERN(str1) OEM_TO_INTERN(str1, str1)
  266. #define _ISO_INTERN(str1) ISO_TO_INTERN(str1, str1)
  267. #ifndef WINDLL
  268. /* Despite best intentions, for the command-line version UzpPassword()
  269. * could return either character set, depending on whether running under
  270. * Win95 (DOS-session) or WinNT (native WinNT command interpreter)! */
  271. # define STR_TO_CP2(dst, src) (AnsiToOem(src, dst), dst)
  272. # define STR_TO_CP3(dst, src) (OemToAnsi(src, dst), dst)
  273. #else
  274. /* The WINDLL front end is known to supply ISO/ANSI-coded passwords! */
  275. # define STR_TO_CP2(dst, src) (AnsiToOem(src, dst), dst)
  276. #endif
  277. /* dummy defines to disable these functions, they are not needed */
  278. #define STR_TO_OEM
  279. #define STR_TO_ISO
  280. /* Static variables that we have to add to Uz_Globs: */
  281. #define SYSTEM_SPECIFIC_GLOBALS \
  282. int created_dir, renamed_fullpath, fnlen;\
  283. unsigned nLabelDrive;\
  284. char lastRootPath[4];\
  285. int lastVolOldFAT, lastVolLocTim;\
  286. char *rootpath, *buildpathHPFS, *buildpathFAT, *endHPFS, *endFAT;\
  287. ZCONST char *wildname;\
  288. char *dirname, matchname[FILNAMSIZ];\
  289. int rootlen, have_dirname, dirnamelen, notfirstcall;\
  290. zvoid *wild_dir;
  291. /* created_dir, renamed_fullpath, fnlen, and nLabelDrive are used by */
  292. /* both mapname() and checkdir(). */
  293. /* lastRootPath, lastVolOldFAT and lastVolLocTim are used by */
  294. /* IsVolumeOldFAT() and NTQueryVolInfo(). */
  295. /* rootlen, rootpath, buildpathHPFS, buildpathFAT, endHPFS, and endFAT */
  296. /* are used by checkdir(). */
  297. /* wild_dir, dirname, wildname, matchname[], dirnamelen, have_dirname, */
  298. /* and notfirstcall are used by do_wild(). */
  299. /* This replacement for C-RTL-supplied getch() (or similar) functionality
  300. * avoids leaving unabsorbed LFs in the keyboard buffer under Windows95,
  301. * and supports the <ALT>+[0]<digit><digit><digit> feature.
  302. */
  303. int getch_win32 OF((void));
  304. /* Up to now, all versions of Microsoft C runtime libraries lack the support
  305. * for customized (non-US) switching rules between daylight saving time and
  306. * standard time in the TZ environment variable string.
  307. * But non-US timezone rules are correctly supported when timezone information
  308. * is read from the OS system settings in the Win32 registry.
  309. * The following work-around deletes any TZ environment setting from
  310. * the process environment. This results in a fallback of the RTL time
  311. * handling code to the (correctly interpretable) OS system settings, read
  312. * from the registry.
  313. */
  314. #ifdef USE_EF_UT_TIME
  315. # if (defined(__WATCOMC__) || defined(__CYGWIN__) || \
  316. defined(W32_USE_IZ_TIMEZONE))
  317. # define iz_w32_prepareTZenv()
  318. # else
  319. # define iz_w32_prepareTZenv() putenv("TZ=")
  320. # endif
  321. #endif
  322. /* This patch of stat() is useful for at least two compilers. It is */
  323. /* difficult to take a stat() of a root directory under Windows95, so */
  324. /* zstat_win32() detects that case and fills in suitable values. */
  325. #ifndef __RSXNT__
  326. # ifndef W32_STATROOT_FIX
  327. # define W32_STATROOT_FIX
  328. # endif
  329. #endif /* !__RSXNT__ */
  330. #define W32_STAT_BANDAID
  331. #if defined(REENTRANT)
  332. # define __W32STAT_GLOBALS__ Uz_Globs *pG,
  333. # define __W32STAT_G__ pG,
  334. #else
  335. # define __W32STAT_GLOBALS__
  336. # define __W32STAT_G__
  337. #endif
  338. #ifdef SSTAT
  339. # undef SSTAT
  340. #endif
  341. #ifdef WILD_STAT_BUG
  342. # define SSTAT(path, pbuf) (iswild(path) || zstat_win32(__W32STAT_G__ path, pbuf))
  343. #else
  344. # define SSTAT(path, pbuf) zstat_win32(__W32STAT_G__ path, pbuf)
  345. #endif
  346. #ifdef __WATCOMC__
  347. # ifdef __386__
  348. # ifndef WATCOMC_386
  349. # define WATCOMC_386
  350. # endif
  351. # define __32BIT__
  352. # undef far
  353. # define far
  354. # undef near
  355. # define near
  356. # undef Cdecl
  357. # define Cdecl
  358. /* gaah -- Watcom's docs claim that _get_osfhandle exists, but it doesn't. */
  359. # define _get_osfhandle _os_handle
  360. /* Get asm routines to link properly without using "__cdecl": */
  361. # ifndef USE_ZLIB
  362. # pragma aux crc32 "_*" parm caller [] value [eax] modify [eax]
  363. # pragma aux get_crc_table "_*" parm caller [] value [eax] \
  364. modify [eax ecx edx]
  365. # endif /* !USE_ZLIB */
  366. # endif /* __386__ */
  367. #endif /* __WATCOMC__ */
  368. #define SCREENWIDTH 80
  369. #define SCREENSIZE(scrrows, scrcols) screensize(scrrows, scrcols)
  370. int screensize(int *tt_rows, int *tt_cols);
  371. /* on the DOS or NT console screen, line-wraps are always enabled */
  372. #define SCREENLWRAP 1
  373. #define TABSIZE 8
  374. /* 64-bit-Integers & Large File Support
  375. * (pasted here from Zip 3b, osdep.h - Myles Bennett 7-jun-2004)
  376. * (updated from Zip 3.0d - Ed Gordon 6-oct-2004)
  377. *
  378. * If this is set it is assumed that the port
  379. * supports 64-bit file calls. The types are
  380. * defined here. Any local implementations are
  381. * in w32i64.c and the prototypes for the calls are
  382. * in unzip.h. Note that a port must support
  383. * these calls fully or should not set
  384. * LARGE_FILE_SUPPORT.
  385. */
  386. /* Automatically set ZIP64_SUPPORT if supported */
  387. #ifndef NO_ZIP64_SUPPORT
  388. # ifndef ZIP64_SUPPORT
  389. # if defined(_MSC_VER) || defined(__MINGW32__) || defined(__CYGWIN__)
  390. # define ZIP64_SUPPORT
  391. # elif defined(__LCC__)
  392. /* LCC links against crtdll.dll -> no support of 64-bit offsets :( */
  393. # elif (defined(__WATCOMC__) && (__WATCOMC__ >= 1100))
  394. # define ZIP64_SUPPORT
  395. # elif (defined(__BORLANDC__) && (__BORLANDC__ >= 0x0520))
  396. /* Borland C RTL lacks any support to get/set 64-bit file pointer :( */
  397. # endif
  398. # endif
  399. #endif
  400. #ifdef ZIP64_SUPPORT
  401. /* base type for file offsets and file sizes */
  402. # if (defined(__GNUC__) || defined(ULONG_LONG_MAX))
  403. typedef long long zoff_t;
  404. # else
  405. /* all other compilers use this as intrinsic 64-bit type */
  406. typedef __int64 zoff_t;
  407. # endif
  408. # define ZOFF_T_DEFINED
  409. /* user-defined types and format strings for 64-bit numbers and
  410. * file pointer functions (these depend on the rtl library and library
  411. * headers used; they are NOT compiler-specific)
  412. */
  413. # if defined(_MSC_VER) || defined(__MINGW32__) || defined(__LCC__)
  414. /* MS C and VC, MinGW32, lcc32 */
  415. /* these systems use the Microsoft C RTL */
  416. /* 64-bit stat struct */
  417. typedef struct _stati64 z_stat;
  418. # define Z_STAT_DEFINED
  419. # ifdef __LCC__
  420. /* The LCC headers lack these declarations of MSC rtl functions in
  421. sys/stat.h. */
  422. struct _stati64 {
  423. unsigned int st_dev;
  424. unsigned short st_ino;
  425. unsigned short st_mode;
  426. short st_nlink;
  427. short st_uid;
  428. short st_gid;
  429. unsigned int st_rdev;
  430. __int64 st_size;
  431. time_t st_atime;
  432. time_t st_mtime;
  433. time_t st_ctime;
  434. };
  435. int _stati64(const char *, struct _stati64 *);
  436. int _fstati64(int, struct _stati64 *);
  437. __int64 _lseeki64(int, __int64, int);
  438. # endif /* __LCC__ */
  439. /* printf format size prefix for zoff_t values */
  440. # define FZOFFT_FMT "I64"
  441. # define FZOFFT_HEX_WID_VALUE "16"
  442. # define SHORTHDRSTATS "%9I64u %02u%c%02u%c%02u %02u:%02u %c"
  443. # define SHORTFILETRAILER " -------- -------\n%9I64u %9lu file%s\n"
  444. # elif (defined(__BORLANDC__) && (__BORLANDC__ >= 0x0520))
  445. /* Borland C 5.2 or newer */
  446. /* 64-bit stat struct */
  447. typedef struct stati64 z_stat;
  448. # define Z_STAT_DEFINED
  449. /* Borland C does not provide a 64-bit-capable _lseeki64(), so we
  450. need to use the stdio.h stream functions instead. */
  451. # ifndef USE_STRM_INPUT
  452. # define USE_STRM_INPUT
  453. # endif
  454. /* printf format size prefix for zoff_t values */
  455. # define FZOFFT_FMT "L"
  456. # define FZOFFT_HEX_WID_VALUE "16"
  457. # define SHORTHDRSTATS "%9Lu %02u%c%02u%c%02u %02u:%02u %c"
  458. # define SHORTFILETRAILER " -------- -------\n%9Lu %9lu file%s\n"
  459. # elif (defined(__WATCOMC__) && (__WATCOMC__ >= 1100))
  460. /* WATCOM C */
  461. /* 64-bit stat struct */
  462. typedef struct _stati64 z_stat;
  463. # define Z_STAT_DEFINED
  464. /* printf format size prefix for zoff_t values */
  465. # define FZOFFT_FMT "ll"
  466. # define FZOFFT_HEX_WID_VALUE "16"
  467. # define SHORTHDRSTATS "%9llu %02u%c%02u%c%02u %02u:%02u %c"
  468. # define SHORTFILETRAILER " -------- -------\n%9llu %9lu file%s\n"
  469. # elif (defined(__IBMC__) && (__IBMC__ >= 350))
  470. /* IBM C */
  471. /* 64-bit stat struct */
  472. /* printf format size prefix for zoff_t values */
  473. # define FZOFFT_FMT "I64"
  474. # define FZOFFT_HEX_WID_VALUE "16"
  475. # define SHORTHDRSTATS "%9I64u %02u%c%02u%c%02u %02u:%02u %c"
  476. # define SHORTFILETRAILER " -------- -------\n%9I64u %9lu file%s\n"
  477. # endif
  478. #endif
  479. /* If port has LARGE_FILE_SUPPORT then define here
  480. to make automatic unless overridden */
  481. #ifndef LARGE_FILE_SUPPORT
  482. # ifndef NO_LARGE_FILE_SUPPORT
  483. # if defined(_MSC_VER) || defined(__MINGW32__)
  484. # define LARGE_FILE_SUPPORT
  485. # elif defined(__LCC__)
  486. /* LCC links against crtdll.dll -> no support of 64-bit offsets :( */
  487. # elif defined(__CYGWIN__)
  488. # define LARGE_FILE_SUPPORT
  489. # elif (defined(__WATCOMC__) && (__WATCOMC__ >= 1100))
  490. # define LARGE_FILE_SUPPORT
  491. # elif (defined(__BORLANDC__) && (__BORLANDC__ >= 0x0520))
  492. /* Borland C RTL lacks any support to get/set 64-bit file pointer :( */
  493. # endif
  494. # endif
  495. #endif
  496. #ifndef LARGE_FILE_SUPPORT
  497. /* No Large File Support */
  498. /* base type for file offsets and file sizes */
  499. typedef long zoff_t;
  500. # define ZOFF_T_DEFINED
  501. /* stat struct */
  502. typedef struct stat z_stat;
  503. # define Z_STAT_DEFINED
  504. # define FZOFFT_FMT "l"
  505. # define FZOFFT_HEX_WID_VALUE "8"
  506. # define SHORTHDRSTATS "%9lu %02u%c%02u%c%02u %02u:%02u %c"
  507. # define SHORTFILETRAILER " -------- -------\n%9lu %9lu file%s\n"
  508. #endif /* LARGE_FILE_SUPPORT */
  509. #endif /* !__w32cfg_h */