comparison src/s/mingw32.h @ 412:697ef44129c6 r21-2-14

Import from CVS: tag r21-2-14
author cvs
date Mon, 13 Aug 2007 11:20:41 +0200
parents de805c49cfc1
children 11054d720c21
comparison
equal deleted inserted replaced
411:12e008d41344 412:697ef44129c6
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */ 19 Boston, MA 02111-1307, USA. */
20 20
21 /* based on cygwin32.h by Andy Piper <andy@xemacs.org> */ 21 /* based on cygwin32.h by Andy Piper <andy@xemacs.org> */
22 22
23 /* Identify ourselves */ 23 #ifndef WINDOWSNT
24 #ifndef WIN32_NATIVE 24 #define WINDOWSNT
25 #define WIN32_NATIVE 25 #endif
26 #endif 26
27 27 #ifndef DOS_NT
28 #define MINGW 28 #define DOS_NT /* MSDOS or WINDOWSNT */
29 #endif
30
31 #define PBS_SMOOTH 0x01
32
33 #ifdef HAVE_MS_WINDOWS
34 #define HAVE_NTGUI
35 #define HAVE_FACES
36 #endif
29 37
30 #ifndef ORDINARY_LINK 38 #ifndef ORDINARY_LINK
31 #define ORDINARY_LINK 39 #define ORDINARY_LINK
32 #endif 40 #endif
33 41
34 #define C_SWITCH_SYSTEM "-mno-cygwin -Wno-sign-compare -fno-caller-saves -DWIN32_NATIVE" 42 #define C_SWITCH_SYSTEM "-mno-cygwin -Wno-sign-compare -fno-caller-saves -Int/inc -I../nt/inc -DWINDOWSNT"
35 #define LIBS_SYSTEM "-mno-cygwin -mwindows -lwinmm -lwsock32" 43 #define LIBS_SYSTEM "-mno-cygwin -lwinmm -lwsock32"
36 #define WIN32_LEAN_AND_MEAN
37 44
38 #define TEXT_START -1 45 #define TEXT_START -1
39 #define TEXT_END -1 46 #define TEXT_END -1
40 #define DATA_END -1 47 #define DATA_END -1
41 #define HEAP_IN_DATA 48 #define HEAP_IN_DATA
42 #define UNEXEC "unexcw.o" 49 #define UNEXEC "unexcw.o"
43 50
44 #define TIME_ONESHOT 0 51 #define TIME_ONESHOT 0
45 #define TIME_PERIODIC 1 52 #define TIME_PERIODIC 1
46 #define LOCALE_USE_CP_ACP 0x40000000 53 #define LOCALE_USE_CP_ACP 0x40000000
54 #define SHGFI_EXETYPE 0x2000
47 #define NSIG 23 55 #define NSIG 23
48
49 /* this is necessary to get the TCS_* definitions in <commctrl.h> */
50 #define _WIN32_IE 0x0400
51 56
52 /* translate NT world unexec stuff to our a.out definitions */ 57 /* translate NT world unexec stuff to our a.out definitions */
53 58
54 #define strnicmp strncasecmp 59 #define strnicmp strncasecmp
55 /* #ifndef HAVE_SOCKETS */ 60 /* #ifndef HAVE_SOCKETS */
56 #define HAVE_SOCKETS 61 #define HAVE_SOCKETS
57 /* #endif */ 62 /* #endif */
58 #define OBJECTS_SYSTEM ntplay.o nt.o ntheap.o ntproc.o dired-msw.o 63 #define OBJECTS_SYSTEM ntplay.o nt.o ntheap.o ntproc.o dired-msw.o
64 #define HAVE_NATIVE_SOUND
59 65
60 #undef MAIL_USE_SYSTEM_LOCK 66 #undef MAIL_USE_SYSTEM_LOCK
67 #define MAIL_USE_POP
61 #define HAVE_MSW_C_DIRED 68 #define HAVE_MSW_C_DIRED
62 69
63 /* Define NO_ARG_ARRAY if you cannot take the address of the first of a 70 /* Define NO_ARG_ARRAY if you cannot take the address of the first of a
64 * group of arguments and treat it as an array of the arguments. */ 71 * group of arguments and treat it as an array of the arguments. */
65 72
66 #define NO_ARG_ARRAY 73 #define NO_ARG_ARRAY
67 74
75 /* Define WORD_MACHINE if addresses and such have
76 * to be corrected before they can be used as byte counts. */
77
78 #define WORD_MACHINE
79
80 /* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend
81 the 24-bit bit field into an int. In other words, if bit fields
82 are always unsigned.
83
84 If you use NO_UNION_TYPE, this flag does not matter. */
85
86 #define EXPLICIT_SIGN_EXTEND
68 /* System calls that are encapsulated */ 87 /* System calls that are encapsulated */
69 #define ENCAPSULATE_RENAME 88 #define ENCAPSULATE_RENAME
70 #define ENCAPSULATE_OPEN 89 #define ENCAPSULATE_OPEN
71 #define ENCAPSULATE_FOPEN 90 #define ENCAPSULATE_FOPEN
72 #define ENCAPSULATE_MKDIR 91 #define ENCAPSULATE_MKDIR
73 #define ENCAPSULATE_STAT
74 #define ENCAPSULATE_FSTAT
75 92
76 /* Data type of load average, as read out of kmem. */ 93 /* Data type of load average, as read out of kmem. */
77 94
78 #define LOAD_AVE_TYPE long 95 #define LOAD_AVE_TYPE long
79 96
88 Otherwise Emacs assumes that text space precedes data space, 105 Otherwise Emacs assumes that text space precedes data space,
89 numerically. */ 106 numerically. */
90 107
91 /* Text does precede data space, but this is never a safe assumption. */ 108 /* Text does precede data space, but this is never a safe assumption. */
92 #define VIRT_ADDR_VARIES 109 #define VIRT_ADDR_VARIES
110
111 /* set this if you have a new version of cygwin
112 #define DATA_SEG_BITS 0x10000000
113 */
93 114
94 /* If you are compiling with a non-C calling convention but need to 115 /* If you are compiling with a non-C calling convention but need to
95 declare vararg routines differently, put it here */ 116 declare vararg routines differently, put it here */
96 #define _VARARGS_ __cdecl 117 #define _VARARGS_ __cdecl
97 118
126 (Which you should place, by convention, in sysdep.c). */ 147 (Which you should place, by convention, in sysdep.c). */
127 148
128 /* Define this to be the separator between devices and paths */ 149 /* Define this to be the separator between devices and paths */
129 #define DEVICE_SEP ':' 150 #define DEVICE_SEP ':'
130 151
131 #define DIRECTORY_SEP ((char)XCHAR(Vdirectory_sep_char)) 152 #define DIRECTORY_SEP '\\'
132 153
133 /* The null device on Windows NT. */ 154 /* The null device on Windows NT. */
134 #define NULL_DEVICE "NUL:" 155 #define NULL_DEVICE "NUL:"
135 #define EXEC_SUFFIXES ".exe:.com:.bat:.cmd:" 156 #define EXEC_SUFFIXES ".exe:.com:.bat:.cmd:"
136 /* We'll support either convention on NT. */ 157 /* We'll support either convention on NT. */
149 #undef mkdir 170 #undef mkdir
150 #ifdef HAVE_CYGWIN_VERSION_H 171 #ifdef HAVE_CYGWIN_VERSION_H
151 #include <cygwin/version.h> 172 #include <cygwin/version.h>
152 #endif 173 #endif
153 174
175 typedef unsigned int MMRESULT;
176 typedef struct timecaps_tag {
177 unsigned int wPeriodMin;
178 unsigned int wPeriodMax;
179 } TIMECAPS;
180
154 /* IO calls that are emulated or shadowed */ 181 /* IO calls that are emulated or shadowed */
155 #define pipe sys_pipe 182 #define pipe sys_pipe
156 int sys_pipe (int * phandles); 183 int sys_pipe (int * phandles);
157 184
158 #ifndef HAVE_X_WINDOWS 185 #ifndef HAVE_X_WINDOWS
160 void sleep (int seconds); 187 void sleep (int seconds);
161 #endif 188 #endif
162 189
163 /* subprocess calls that are emulated */ 190 /* subprocess calls that are emulated */
164 #define spawnve sys_spawnve 191 #define spawnve sys_spawnve
165 int spawnve (int mode, const char *cmdname, 192 int spawnve (int mode, CONST char *cmdname,
166 const char * const *argv, const char *const *envp); 193 CONST char * CONST *argv, CONST char *CONST *envp);
167 194
168 #define wait sys_wait 195 #define wait sys_wait
169 int wait (int *status); 196 int wait (int *status);
170 197
171 #define kill sys_kill 198 #define kill sys_kill
176 #define pclose _pclose 203 #define pclose _pclose
177 204
178 /* Encapsulation of system calls */ 205 /* Encapsulation of system calls */
179 #ifndef DONT_ENCAPSULATE 206 #ifndef DONT_ENCAPSULATE
180 #define getpid sys_getpid 207 #define getpid sys_getpid
181 pid_t getpid (void); 208 int getpid (void);
182 #endif 209 #endif
183 210
184 #define DONT_USE_LITOUT 211 #define DONT_USE_LITOUT
185 212
186 /* Random global functions called everywhere. Implemented in nt.c */ 213 /* Random global functions called everywhere. Implemented in nt.c */
193 char *getwd (char *dir); 220 char *getwd (char *dir);
194 221
195 void *sbrk (unsigned long increment); 222 void *sbrk (unsigned long increment);
196 223
197 struct passwd; 224 struct passwd;
198 struct passwd *getpwuid (uid_t uid); 225 struct passwd *getpwuid (int uid);
199 struct passwd *getpwnam (const char *name); 226 struct passwd *getpwnam (const char *name);
200 uid_t getuid (void); 227 int getuid ();
201 uid_t geteuid (void); 228 int geteuid ();
202 gid_t getgid (void); 229 int getgid (void);
203 gid_t getegid (void); 230 int getegid ();
204
205 #if CYGWIN_VERSION_DLL_MAJOR <= 21
206 #define _ftime ftime
207 #define _timeb timeb 231 #define _timeb timeb
208 #endif
209 232
210 /* Stuff that gets set wrongly or otherwise */ 233 /* Stuff that gets set wrongly or otherwise */
211 #define HAVE_SETITIMER 234 #define HAVE_SETITIMER
212 #define HAVE_GETTIMEOFDAY 235 #define HAVE_GETTIMEOFDAY
213 #define HAVE_SELECT 236 #define HAVE_SELECT
214 /* systime.h includes winsock.h which defines timeval */
215 #define HAVE_TIMEVAL
216 #define HAVE_GETPAGESIZE
217 #define getpagesize() 4096
218 /*#define HAVE_STRUCT_UTIMBUF*/ 237 /*#define HAVE_STRUCT_UTIMBUF*/
219 #ifndef HAVE_H_ERRNO
220 #define HAVE_H_ERRNO
221 #endif
222 #ifndef HAVE_TZNAME
223 #define HAVE_TZNAME
224 #endif
225 238
226 #undef GETTIMEOFDAY_ONE_ARGUMENT 239 #undef GETTIMEOFDAY_ONE_ARGUMENT
227 #undef HAVE_SYS_WAIT_H 240 #undef HAVE_SYS_WAIT_H
228 #undef HAVE_TERMIOS 241 #undef HAVE_TERMIOS
229 #undef SYSV_SYSTEM_DIR 242 #undef SYSV_SYSTEM_DIR
230 #undef CLASH_DETECTION
231 243
232 /* We now have emulation for some signals */ 244 /* We now have emulation for some signals */
233 #define HAVE_SIGHOLD 245 #define HAVE_SIGHOLD
234 #define sigset(s,h) mswindows_sigset(s,h) 246 #define sigset(s,h) msw_sigset(s,h)
235 #define sighold(s) mswindows_sighold(s) 247 #define sighold(s) msw_sighold(s)
236 #define sigrelse(s) mswindows_sigrelse(s) 248 #define sigrelse(s) msw_sigrelse(s)
237 #define sigpause(s) mswindows_sigpause(s) 249 #define sigpause(s) msw_sigpause(s)
238 #define signal sigset 250 #define signal sigset
239 251
240 /* Defines that we need that aren't in the standard signal.h */ 252 /* Defines that we need that aren't in the standard signal.h */
241 #define SIGHUP 1 /* Hang up */ 253 #define SIGHUP 1 /* Hang up */
242 #define SIGQUIT 3 /* Quit process */ 254 #define SIGQUIT 3 /* Quit process */
245 #define SIGPROF 29 /* Profiling timer exp */ 257 #define SIGPROF 29 /* Profiling timer exp */
246 258
247 #ifndef MAXPATHLEN 259 #ifndef MAXPATHLEN
248 #define MAXPATHLEN _MAX_PATH 260 #define MAXPATHLEN _MAX_PATH
249 #endif 261 #endif
250 #endif /* !NOT_C_CODE */ 262
263 /* For integration with MSDOS support. */
264 #define getdisk() (_getdrive () - 1)
265 #define getdefdir(_drv, _buf) _getdcwd (_drv, _buf, MAXPATHLEN)
266 #endif
251 267
252 /* Define for those source files that do not include enough NT 268 /* Define for those source files that do not include enough NT
253 system files. */ 269 system files. */
254 #ifndef NULL 270 #ifndef NULL
255 #ifdef __cplusplus 271 #ifdef __cplusplus
260 #endif 276 #endif
261 277
262 /* Define process implementation */ 278 /* Define process implementation */
263 #define HAVE_WIN32_PROCESSES 279 #define HAVE_WIN32_PROCESSES
264 280
265 #define CORRECT_DIR_SEPS(s) \ 281 /* ============================================================ */
266 do { if ('/' == DIRECTORY_SEP) dostounix_filename (s); \ 282
267 else unixtodos_filename (s); \
268 } while (0)