annotate src/s/mingw32.h @ 398:74fd4e045ea6 r21-2-29

Import from CVS: tag r21-2-29
author cvs
date Mon, 13 Aug 2007 11:13:30 +0200
parents
children a86b2b5e0111
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
1 /* system description file for mingw32.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
2 Copyright (C) 1993, 1994, 1995, 1999 Free Software Foundation, Inc.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
3
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
4 This file is part of GNU Emacs.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
5
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
6 GNU Emacs is free software; you can redistribute it and/or modify
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
7 it under the terms of the GNU General Public License as published by
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
8 the Free Software Foundation; either version 2, or (at your option)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
9 any later version.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
10
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
11 GNU Emacs is distributed in the hope that it will be useful,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
14 GNU General Public License for more details.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
15
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
17 along with XEmacs; see the file COPYING. If not, write to
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
19 Boston, MA 02111-1307, USA. */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
20
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
21 /* based on cygwin32.h by Andy Piper <andy@xemacs.org> */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
22
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
23 #ifndef WINDOWSNT
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
24 #define WINDOWSNT
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
25 #endif
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
26
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
27 #ifndef DOS_NT
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
28 #define DOS_NT /* MSDOS or WINDOWSNT */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
29 #endif
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
30
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
31 #define PBS_SMOOTH 0x01
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
32
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
33 #ifdef HAVE_MS_WINDOWS
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
34 #define HAVE_NTGUI
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
35 #define HAVE_FACES
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
36 #endif
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
37
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
38 #ifndef ORDINARY_LINK
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
39 #define ORDINARY_LINK
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
40 #endif
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
41
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
42 #define C_SWITCH_SYSTEM "-mno-cygwin -Wno-sign-compare -fno-caller-saves -Int/inc -I../nt/inc -DWINDOWSNT"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
43 #define LIBS_SYSTEM "-mno-cygwin -lwinmm -lwsock32"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
44
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
45 #define TEXT_START -1
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
46 #define TEXT_END -1
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
47 #define DATA_END -1
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
48 #define HEAP_IN_DATA
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
49 #define UNEXEC "unexcw.o"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
50
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
51 #define TIME_ONESHOT 0
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
52 #define TIME_PERIODIC 1
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
53 #define LOCALE_USE_CP_ACP 0x40000000
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
54 #define SHGFI_EXETYPE 0x2000
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
55 #define NSIG 23
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
56
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
57 #ifndef SPI_GETWHEELSCROLLLINES
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
58 #define SPI_GETWHEELSCROLLLINES 104
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
59 #endif
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
60 #ifndef WHEEL_PAGESCROLL
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
61 #define WHEEL_PAGESCROLL (UINT_MAX)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
62 #endif
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
63 #ifndef WHEEL_DELTA
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
64 #define WHEEL_DELTA 120
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
65 #endif
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
66 #ifndef WM_MOUSEWHEEL
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
67 #define WM_MOUSEWHEEL 0x20A
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
68 #endif
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
69
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
70 /* translate NT world unexec stuff to our a.out definitions */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
71
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
72 #define strnicmp strncasecmp
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
73 /* #ifndef HAVE_SOCKETS */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
74 #define HAVE_SOCKETS
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
75 /* #endif */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
76 #define OBJECTS_SYSTEM ntplay.o nt.o ntheap.o ntproc.o dired-msw.o
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
77 #define HAVE_NATIVE_SOUND
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
78
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
79 #undef MAIL_USE_SYSTEM_LOCK
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
80 #define MAIL_USE_POP
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
81 #define HAVE_MSW_C_DIRED
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
82
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
83 /* Define NO_ARG_ARRAY if you cannot take the address of the first of a
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
84 * group of arguments and treat it as an array of the arguments. */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
85
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
86 #define NO_ARG_ARRAY
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
87
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
88 /* Define WORD_MACHINE if addresses and such have
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
89 * to be corrected before they can be used as byte counts. */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
90
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
91 #define WORD_MACHINE
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
92
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
93 /* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
94 the 24-bit bit field into an int. In other words, if bit fields
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
95 are always unsigned.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
96
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
97 If you use NO_UNION_TYPE, this flag does not matter. */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
98
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
99 #define EXPLICIT_SIGN_EXTEND
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
100 /* System calls that are encapsulated */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
101 #define ENCAPSULATE_RENAME
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
102 #define ENCAPSULATE_OPEN
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
103 #define ENCAPSULATE_FOPEN
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
104 #define ENCAPSULATE_MKDIR
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
105
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
106 /* Data type of load average, as read out of kmem. */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
107
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
108 #define LOAD_AVE_TYPE long
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
109
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
110 /* Convert that into an integer that is 100 for a load average of 1.0 */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
111
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
112 #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
113
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
114 /* Define VIRT_ADDR_VARIES if the virtual addresses of
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
115 pure and impure space as loaded can vary, and even their
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
116 relative order cannot be relied on.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
117
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
118 Otherwise Emacs assumes that text space precedes data space,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
119 numerically. */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
120
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
121 /* Text does precede data space, but this is never a safe assumption. */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
122 #define VIRT_ADDR_VARIES
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
123
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
124 /* set this if you have a new version of cygwin
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
125 #define DATA_SEG_BITS 0x10000000
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
126 */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
127
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
128 /* If you are compiling with a non-C calling convention but need to
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
129 declare vararg routines differently, put it here */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
130 #define _VARARGS_ __cdecl
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
131
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
132 /* If you are providing a function to something that will call the
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
133 function back (like a signal handler and signal, or main) its calling
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
134 convention must be whatever standard the libraries expect */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
135 #define _CALLBACK_ __cdecl
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
136
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
137 /* SYSTEM_TYPE should indicate the kind of system you are using.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
138 It sets the Lisp variable system-type. */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
139
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
140 #define SYSTEM_TYPE "windows-nt"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
141
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
142 #define NO_MATHERR
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
143
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
144 /* define MAIL_USE_FLOCK if the mailer uses flock
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
145 to interlock access to /usr/spool/mail/$USER.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
146 The alternative is that a lock file named
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
147 /usr/spool/mail/$USER.lock. */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
148
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
149 /* If the character used to separate elements of the executable path
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
150 is not ':', #define this to be the appropriate character constant. */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
151 #define SEPCHAR ';'
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
152
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
153 /* ============================================================ */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
154
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
155 /* Here, add any special hacks needed
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
156 to make Emacs work on this system. For example,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
157 you might define certain system call names that don't
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
158 exist on your system, or that do different things on
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
159 your system and must be used only through an encapsulation
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
160 (Which you should place, by convention, in sysdep.c). */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
161
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
162 /* Define this to be the separator between devices and paths */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
163 #define DEVICE_SEP ':'
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
164
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
165 #define DIRECTORY_SEP '\\'
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
166
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
167 /* The null device on Windows NT. */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
168 #define NULL_DEVICE "NUL:"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
169 #define EXEC_SUFFIXES ".exe:.com:.bat:.cmd:"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
170 /* We'll support either convention on NT. */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
171 #define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\')
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
172 #define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
173 #define EXEC_SUFFIXES ".exe:.com:.bat:.cmd:"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
174
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
175 /* We need a little extra space, see ../../lisp/loadup.el */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
176 #define SYSTEM_PURESIZE_EXTRA 15000
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
177
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
178 #ifndef NOT_C_CODE
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
179 #include <stdlib.h>
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
180 #include <mingw32/process.h>
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
181 #define mkdir __mkdir
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
182 #include <dir.h>
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
183 #undef mkdir
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
184 #ifdef HAVE_CYGWIN_VERSION_H
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
185 #include <cygwin/version.h>
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
186 #endif
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
187
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
188 typedef unsigned int MMRESULT;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
189 typedef struct timecaps_tag {
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
190 unsigned int wPeriodMin;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
191 unsigned int wPeriodMax;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
192 } TIMECAPS;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
193
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
194 /* IO calls that are emulated or shadowed */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
195 #define pipe sys_pipe
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
196 int sys_pipe (int * phandles);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
197
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
198 #ifndef HAVE_X_WINDOWS
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
199 #define sleep sys_sleep
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
200 void sleep (int seconds);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
201 #endif
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
202
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
203 /* subprocess calls that are emulated */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
204 #define spawnve sys_spawnve
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
205 int spawnve (int mode, const char *cmdname,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
206 const char * const *argv, const char *const *envp);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
207
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
208 #define wait sys_wait
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
209 int wait (int *status);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
210
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
211 #define kill sys_kill
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
212 int kill (int pid, int sig);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
213
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
214 /* map to MSVC names */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
215 #define popen _popen
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
216 #define pclose _pclose
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
217
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
218 typedef int uid_t;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
219 typedef int gid_t;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
220 typedef int pid_t;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
221 typedef int ssize_t;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
222
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
223 /* Encapsulation of system calls */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
224 #ifndef DONT_ENCAPSULATE
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
225 #define getpid sys_getpid
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
226 pid_t getpid (void);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
227 #endif
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
228
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
229 #define DONT_USE_LITOUT
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
230
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
231 /* Random global functions called everywhere. Implemented in nt.c */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
232 /* #### Most of these are FSFisms and must be avoided */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
233 /* #### All of these are FSFisms and must be avoided */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
234 void dostounix_filename (char *p);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
235 void unixtodos_filename (char *p);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
236 int crlf_to_lf (int n, unsigned char *buf, unsigned int *lf_count);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
237
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
238 char *getwd (char *dir);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
239
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
240 void *sbrk (unsigned long increment);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
241
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
242 struct passwd;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
243 struct passwd *getpwuid (uid_t uid);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
244 struct passwd *getpwnam (const char *name);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
245 uid_t getuid (void);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
246 uid_t geteuid (void);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
247 gid_t getgid (void);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
248 gid_t getegid (void);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
249 #define _timeb timeb
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
250
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
251 /* Stuff that gets set wrongly or otherwise */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
252 #define HAVE_SETITIMER
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
253 #define HAVE_GETTIMEOFDAY
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
254 #define HAVE_SELECT
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
255 /*#define HAVE_STRUCT_UTIMBUF*/
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
256
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
257 #undef GETTIMEOFDAY_ONE_ARGUMENT
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
258 #undef HAVE_SYS_WAIT_H
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
259 #undef HAVE_TERMIOS
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
260 #undef SYSV_SYSTEM_DIR
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
261
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
262 /* We now have emulation for some signals */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
263 #define HAVE_SIGHOLD
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
264 #define sigset(s,h) msw_sigset(s,h)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
265 #define sighold(s) msw_sighold(s)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
266 #define sigrelse(s) msw_sigrelse(s)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
267 #define sigpause(s) msw_sigpause(s)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
268 #define signal sigset
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
269
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
270 /* Defines that we need that aren't in the standard signal.h */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
271 #define SIGHUP 1 /* Hang up */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
272 #define SIGQUIT 3 /* Quit process */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
273 #define SIGKILL 9 /* Die, die die */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
274 #define SIGALRM 14 /* Alarm */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
275 #define SIGPROF 29 /* Profiling timer exp */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
276
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
277 #ifndef MAXPATHLEN
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
278 #define MAXPATHLEN _MAX_PATH
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
279 #endif
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
280
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
281 /* For integration with MSDOS support. */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
282 #define getdisk() (_getdrive () - 1)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
283 #define getdefdir(_drv, _buf) _getdcwd (_drv, _buf, MAXPATHLEN)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
284 #endif
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
285
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
286 /* Define for those source files that do not include enough NT
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
287 system files. */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
288 #ifndef NULL
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
289 #ifdef __cplusplus
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
290 #define NULL 0
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
291 #else
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
292 #define NULL ((void *)0)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
293 #endif
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
294 #endif
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
295
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
296 /* Define process implementation */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
297 #define HAVE_WIN32_PROCESSES
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
298
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
299 /* ============================================================ */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents:
diff changeset
300