]>
git.saurik.com Git - wxWidgets.git/blob - utils/Install/inczip/w32cfg.h
1 /*---------------------------------------------------------------------------
2 Win32 specific configuration section:
3 ---------------------------------------------------------------------------*/
8 #if (defined(__CYGWIN__) && !defined(__CYGWIN32__))
9 # define __CYGWIN32__ /* new versions of CygWin may not define this */
12 #include <sys/types.h> /* off_t, time_t, dev_t, ... */
14 #include <io.h> /* read(), open(), etc. */
16 #if (defined(__RSXNT__) || defined(__EMX__)) && !defined(tzset)
20 extern void _tzset(void); /* this is missing in <time.h> */
26 #if (!defined(__RSXNT__) && !defined(__CYGWIN32__))
27 # include <direct.h> /* mkdir() */
32 extern int setmode(int, int); /* this is missing in <fcntl.h> */
34 #if (defined(MSC) || defined(__WATCOMC__) || defined(__MINGW32__))
35 # include <sys/utime.h>
46 # include "win32/rsxntwin.h"
49 #if (defined(ENVARGS_C) || defined(EXTRACT_C) || defined(UNZIP_C) || \
50 defined(ZCRYPT_INTERNAL))
53 # include "win32/rsxntwin.h"
56 #if (defined(__CYGWIN32__) || defined(__MINGW32__))
57 /* the following definitions are missing in their <windows.h> */
59 # define AnsiToOem CharToOemA
62 # define OemToAnsi OemToCharA
66 #define DIR_END '\\' /* OS uses '\\' as directory separator */
67 #define DIR_END2 '/' /* also check for '/' (RTL may convert) */
69 # define DATE_FORMAT DF_MDY
72 #define PutNativeEOL {*q++ = native(CR); *q++ = native(LF);}
74 #if (defined(__RSXNT__) && !defined(HAVE_MKTIME))
75 # define HAVE_MKTIME /* use mktime() in time conversion routines */
77 #if (defined(__CYGWIN32__) && defined(HAVE_MKTIME))
78 # undef HAVE_MKTIME /* Cygnus' mktime() implementation is buggy */
80 #if (!defined(NT_TZBUG_WORKAROUND) && !defined(NO_NT_TZBUG_WORKAROUND))
81 # define NT_TZBUG_WORKAROUND
83 #if (!defined(NO_EF_UT_TIME) && !defined(USE_EF_UT_TIME))
84 # define USE_EF_UT_TIME
86 #if (!defined(NOTIMESTAMP) && !defined(TIMESTAMP))
89 #if (!defined(NO_NTSD_EAS) && !defined(NTSD_EAS))
90 # define NTSD_EAS /* enable NTSD support unless explicitly suppressed */
93 /* handlers for OEM <--> ANSI string conversions */
95 /* RSXNT uses OEM coded strings in functions supplied by C RTL */
96 # ifdef CRTL_CP_IS_ISO
97 # undef CRTL_CP_IS_ISO
99 # ifndef CRTL_CP_IS_OEM
100 # define CRTL_CP_IS_OEM
103 /* "real" native WIN32 compilers use ANSI coded strings in C RTL calls */
104 # ifndef CRTL_CP_IS_ISO
105 # define CRTL_CP_IS_ISO
107 # ifdef CRTL_CP_IS_OEM
108 # undef CRTL_CP_IS_OEM
112 #ifdef CRTL_CP_IS_ISO
113 /* C RTL's file system support assumes ANSI coded strings */
114 # define ISO_TO_INTERN(src, dst) {if ((src) != (dst)) strcpy((dst), (src));}
115 # define OEM_TO_INTERN(src, dst) OemToAnsi(src, dst)
116 # define INTERN_TO_ISO(src, dst) {if ((src) != (dst)) strcpy((dst), (src));}
117 # define INTERN_TO_OEM(src, dst) AnsiToOem(src, dst)
118 #endif /* CRTL_CP_IS_ISO */
119 #ifdef CRTL_CP_IS_OEM
120 /* C RTL's file system support assumes OEM coded strings */
121 # define ISO_TO_INTERN(src, dst) AnsiToOem(src, dst)
122 # define OEM_TO_INTERN(src, dst) {if ((src) != (dst)) strcpy((dst), (src));}
123 # define INTERN_TO_ISO(src, dst) OemToAnsi(src, dst)
124 # define INTERN_TO_OEM(src, dst) {if ((src) != (dst)) strcpy((dst), (src));}
125 #endif /* CRTL_CP_IS_OEM */
126 #define _OEM_INTERN(str1) OEM_TO_INTERN(str1, str1)
127 #define _ISO_INTERN(str1) ISO_TO_INTERN(str1, str1)
129 /* Despite best intentions, for the command-line version UzpPassword()
130 * could return either character set, depending on whether running under
131 * Win95 (DOS-session) or WinNT (native WinNT command interpreter)! */
132 # define STR_TO_CP2(dst, src) (AnsiToOem(src, dst), dst)
133 # define STR_TO_CP3(dst, src) (OemToAnsi(src, dst), dst)
135 /* The WINDLL front end is known to supply ISO/ANSI-coded passwords! */
136 # define STR_TO_CP2(dst, src) (AnsiToOem(src, dst), dst)
138 /* dummy defines to disable these functions, they are not needed */
142 /* Static variables that we have to add to Uz_Globs: */
143 #define SYSTEM_SPECIFIC_GLOBALS \
144 int created_dir, renamed_fullpath, fnlen;\
145 unsigned nLabelDrive;\
146 char lastRootPath[4];\
147 int lastVolOldFAT, lastVolLocTim;\
148 char *rootpath, *buildpathHPFS, *buildpathFAT, *endHPFS, *endFAT;\
149 char *dirname, *wildname, matchname[FILNAMSIZ];\
150 int rootlen, have_dirname, dirnamelen, notfirstcall;\
153 /* created_dir, renamed_fullpath, fnlen, and nLabelDrive are used by */
154 /* both mapname() and checkdir(). */
155 /* lastRootPath and lastVolOldFAT are used by IsVolumeOldFAT(). */
156 /* rootlen, rootpath, buildpathHPFS, buildpathFAT, endHPFS, and endFAT */
157 /* are used by checkdir(). */
158 /* wild_dir, dirname, wildname, matchname[], dirnamelen, have_dirname, */
159 /* and notfirstcall are used by do_wild(). */
161 #if (defined(_MSC_VER) && !defined(MSC))
165 /* This replacement for C-RTL-supplied getch() (or similar) functionality
166 * avoids leaving unabsorbed LFs in the keyboard buffer under Windows95,
167 * and supports the <ALT>+[0]<digit><digit><digit> feature.
169 int getch_win32
OF((void));
171 /* This patch of stat() is useful for at least two compilers. It is */
172 /* difficult to take a stat() of a root directory under Windows95, so */
173 /* zstat_win32() detects that case and fills in suitable values. */
175 # ifndef W32_STATROOT_FIX
176 # define W32_STATROOT_FIX
178 #endif /* !__RSXNT__ */
180 #if (defined(NT_TZBUG_WORKAROUND) || defined(W32_STATROOT_FIX))
181 # define W32_STAT_BANDAID
182 # if (defined(NT_TZBUG_WORKAROUND) && defined(REENTRANT))
183 # define __W32STAT_GLOBALS__ Uz_Globs *pG,
184 # define __W32STAT_G__ pG,
186 # define __W32STAT_GLOBALS__
187 # define __W32STAT_G__
190 # ifdef WILD_STAT_BUG
191 # define SSTAT(path, pbuf) (iswild(path) || zstat_win32(__W32STAT_G__ path, pbuf))
193 # define SSTAT(path, pbuf) zstat_win32(__W32STAT_G__ path, pbuf)
208 /* Get asm routines to link properly without using "__cdecl": */
210 # pragma aux crc32 "_*" parm caller [] value [eax] modify [eax]
211 # pragma aux get_crc_table "_*" parm caller [] value [eax] \
213 # endif /* !USE_ZLIB */
214 # endif /* __386__ */
219 # define PIPE_ERROR (errno == EPIPE)
220 #endif /* __WATCOMC__ */
222 #endif /* !__w32cfg_h */