Mercurial > hg > xemacs-beta
comparison src/s/mingw32.h @ 442:abe6d1db359e r21-2-36
Import from CVS: tag r21-2-36
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:35:02 +0200 |
parents | 3ecd8885ac67 |
children | 223736d75acb |
comparison
equal
deleted
inserted
replaced
441:72a7cfa4a488 | 442:abe6d1db359e |
---|---|
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 #ifndef WINDOWSNT | 23 /* Identify ourselves */ |
24 #define WINDOWSNT | 24 #ifndef WIN32_NATIVE |
25 #endif | 25 #define WIN32_NATIVE |
26 | 26 #endif |
27 #ifndef DOS_NT | 27 |
28 #define DOS_NT /* MSDOS or WINDOWSNT */ | 28 #define MINGW |
29 #endif | |
30 | |
31 #define PBS_SMOOTH 0x01 | |
32 | |
33 #ifdef HAVE_MS_WINDOWS | |
34 #define HAVE_NTGUI | |
35 #define HAVE_FACES | |
36 #endif | |
37 | 29 |
38 #ifndef ORDINARY_LINK | 30 #ifndef ORDINARY_LINK |
39 #define ORDINARY_LINK | 31 #define ORDINARY_LINK |
40 #endif | 32 #endif |
41 | 33 |
42 #define C_SWITCH_SYSTEM "-mno-cygwin -Wno-sign-compare -fno-caller-saves -Int/inc -I../nt/inc -DWINDOWSNT" | 34 #define C_SWITCH_SYSTEM "-mno-cygwin -Wno-sign-compare -fno-caller-saves -DWIN32_NATIVE" |
43 #define LIBS_SYSTEM "-mno-cygwin -lwinmm -lwsock32" | 35 #define LIBS_SYSTEM "-mno-cygwin -mwindows -lwinmm -lwsock32" |
36 #define WIN32_LEAN_AND_MEAN | |
44 | 37 |
45 #define TEXT_START -1 | 38 #define TEXT_START -1 |
46 #define TEXT_END -1 | 39 #define TEXT_END -1 |
47 #define DATA_END -1 | 40 #define DATA_END -1 |
48 #define HEAP_IN_DATA | 41 #define HEAP_IN_DATA |
49 #define UNEXEC "unexcw.o" | 42 #define UNEXEC "unexcw.o" |
50 | 43 |
51 #define TIME_ONESHOT 0 | 44 #define TIME_ONESHOT 0 |
52 #define TIME_PERIODIC 1 | 45 #define TIME_PERIODIC 1 |
53 #define LOCALE_USE_CP_ACP 0x40000000 | 46 #define LOCALE_USE_CP_ACP 0x40000000 |
54 #define SHGFI_EXETYPE 0x2000 | |
55 #define NSIG 23 | 47 #define NSIG 23 |
56 | 48 |
57 #ifndef SPI_GETWHEELSCROLLLINES | 49 /* this is necessary to get the TCS_* definitions in <commctrl.h> */ |
58 #define SPI_GETWHEELSCROLLLINES 104 | 50 #define _WIN32_IE 0x0400 |
59 #endif | |
60 #ifndef WHEEL_PAGESCROLL | |
61 #define WHEEL_PAGESCROLL (UINT_MAX) | |
62 #endif | |
63 #ifndef WHEEL_DELTA | |
64 #define WHEEL_DELTA 120 | |
65 #endif | |
66 #ifndef WM_MOUSEWHEEL | |
67 #define WM_MOUSEWHEEL 0x20A | |
68 #endif | |
69 | 51 |
70 /* translate NT world unexec stuff to our a.out definitions */ | 52 /* translate NT world unexec stuff to our a.out definitions */ |
71 | 53 |
72 #define strnicmp strncasecmp | 54 #define strnicmp strncasecmp |
73 /* #ifndef HAVE_SOCKETS */ | 55 /* #ifndef HAVE_SOCKETS */ |
74 #define HAVE_SOCKETS | 56 #define HAVE_SOCKETS |
75 /* #endif */ | 57 /* #endif */ |
76 #define OBJECTS_SYSTEM ntplay.o nt.o ntheap.o ntproc.o dired-msw.o | 58 #define OBJECTS_SYSTEM ntplay.o nt.o ntheap.o ntproc.o dired-msw.o |
77 #define HAVE_NATIVE_SOUND | |
78 | 59 |
79 #undef MAIL_USE_SYSTEM_LOCK | 60 #undef MAIL_USE_SYSTEM_LOCK |
80 #define MAIL_USE_POP | |
81 #define HAVE_MSW_C_DIRED | 61 #define HAVE_MSW_C_DIRED |
82 | 62 |
83 /* Define NO_ARG_ARRAY if you cannot take the address of the first of a | |
84 * group of arguments and treat it as an array of the arguments. */ | |
85 | |
86 #define NO_ARG_ARRAY | |
87 | |
88 /* Define WORD_MACHINE if addresses and such have | |
89 * to be corrected before they can be used as byte counts. */ | |
90 | |
91 #define WORD_MACHINE | |
92 | |
93 /* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend | |
94 the 24-bit bit field into an int. In other words, if bit fields | |
95 are always unsigned. | |
96 | |
97 If you use NO_UNION_TYPE, this flag does not matter. */ | |
98 | |
99 #define EXPLICIT_SIGN_EXTEND | |
100 /* System calls that are encapsulated */ | 63 /* System calls that are encapsulated */ |
101 #define ENCAPSULATE_RENAME | 64 #define ENCAPSULATE_RENAME |
102 #define ENCAPSULATE_OPEN | 65 #define ENCAPSULATE_OPEN |
103 #define ENCAPSULATE_FOPEN | 66 #define ENCAPSULATE_FOPEN |
104 #define ENCAPSULATE_MKDIR | 67 #define ENCAPSULATE_MKDIR |
105 | 68 #define ENCAPSULATE_STAT |
106 /* Data type of load average, as read out of kmem. */ | 69 #define ENCAPSULATE_FSTAT |
107 | 70 |
108 #define LOAD_AVE_TYPE long | 71 /* Do not define LOAD_AVE_TYPE or LOAD_AVE_CVT |
109 | 72 since there is no load average available. */ |
110 /* Convert that into an integer that is 100 for a load average of 1.0 */ | |
111 | |
112 #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) | |
113 | 73 |
114 /* Define VIRT_ADDR_VARIES if the virtual addresses of | 74 /* Define VIRT_ADDR_VARIES if the virtual addresses of |
115 pure and impure space as loaded can vary, and even their | 75 pure and impure space as loaded can vary, and even their |
116 relative order cannot be relied on. | 76 relative order cannot be relied on. |
117 | 77 |
118 Otherwise Emacs assumes that text space precedes data space, | 78 Otherwise Emacs assumes that text space precedes data space, |
119 numerically. */ | 79 numerically. */ |
120 | 80 |
121 /* Text does precede data space, but this is never a safe assumption. */ | 81 /* Text does precede data space, but this is never a safe assumption. */ |
122 #define VIRT_ADDR_VARIES | 82 #define VIRT_ADDR_VARIES |
123 | |
124 /* set this if you have a new version of cygwin | |
125 #define DATA_SEG_BITS 0x10000000 | |
126 */ | |
127 | 83 |
128 /* If you are compiling with a non-C calling convention but need to | 84 /* If you are compiling with a non-C calling convention but need to |
129 declare vararg routines differently, put it here */ | 85 declare vararg routines differently, put it here */ |
130 #define _VARARGS_ __cdecl | 86 #define _VARARGS_ __cdecl |
131 | 87 |
160 (Which you should place, by convention, in sysdep.c). */ | 116 (Which you should place, by convention, in sysdep.c). */ |
161 | 117 |
162 /* Define this to be the separator between devices and paths */ | 118 /* Define this to be the separator between devices and paths */ |
163 #define DEVICE_SEP ':' | 119 #define DEVICE_SEP ':' |
164 | 120 |
165 #define DIRECTORY_SEP '\\' | 121 #define DIRECTORY_SEP ((char)XCHAR(Vdirectory_sep_char)) |
166 | 122 |
167 /* The null device on Windows NT. */ | 123 /* The null device on Windows NT. */ |
168 #define NULL_DEVICE "NUL:" | 124 #define NULL_DEVICE "NUL:" |
169 #define EXEC_SUFFIXES ".exe:.com:.bat:.cmd:" | 125 #define EXEC_SUFFIXES ".exe:.com:.bat:.cmd:" |
170 /* We'll support either convention on NT. */ | 126 /* We'll support either convention on NT. */ |
183 #undef mkdir | 139 #undef mkdir |
184 #ifdef HAVE_CYGWIN_VERSION_H | 140 #ifdef HAVE_CYGWIN_VERSION_H |
185 #include <cygwin/version.h> | 141 #include <cygwin/version.h> |
186 #endif | 142 #endif |
187 | 143 |
188 typedef unsigned int MMRESULT; | |
189 typedef struct timecaps_tag { | |
190 unsigned int wPeriodMin; | |
191 unsigned int wPeriodMax; | |
192 } TIMECAPS; | |
193 | |
194 /* IO calls that are emulated or shadowed */ | 144 /* IO calls that are emulated or shadowed */ |
195 #define pipe sys_pipe | 145 #define pipe sys_pipe |
196 int sys_pipe (int * phandles); | 146 int sys_pipe (int * phandles); |
197 | 147 |
198 #ifndef HAVE_X_WINDOWS | 148 #ifndef HAVE_X_WINDOWS |
200 void sleep (int seconds); | 150 void sleep (int seconds); |
201 #endif | 151 #endif |
202 | 152 |
203 /* subprocess calls that are emulated */ | 153 /* subprocess calls that are emulated */ |
204 #define spawnve sys_spawnve | 154 #define spawnve sys_spawnve |
205 int spawnve (int mode, CONST char *cmdname, | 155 int spawnve (int mode, const char *cmdname, |
206 CONST char * CONST *argv, CONST char *CONST *envp); | 156 const char * const *argv, const char *const *envp); |
207 | 157 |
208 #define wait sys_wait | 158 #define wait sys_wait |
209 int wait (int *status); | 159 int wait (int *status); |
210 | 160 |
211 #define kill sys_kill | 161 #define kill sys_kill |
212 int kill (int pid, int sig); | 162 int kill (int pid, int sig); |
213 | 163 |
214 /* map to MSVC names */ | 164 /* map to MSVC names */ |
215 #define popen _popen | 165 #define popen _popen |
216 #define pclose _pclose | 166 #define pclose _pclose |
217 | |
218 typedef int uid_t; | |
219 typedef int gid_t; | |
220 typedef int pid_t; | |
221 typedef int ssize_t; | |
222 | 167 |
223 /* Encapsulation of system calls */ | 168 /* Encapsulation of system calls */ |
224 #ifndef DONT_ENCAPSULATE | 169 #ifndef DONT_ENCAPSULATE |
225 #define getpid sys_getpid | 170 #define getpid sys_getpid |
226 pid_t getpid (void); | 171 pid_t getpid (void); |
244 struct passwd *getpwnam (const char *name); | 189 struct passwd *getpwnam (const char *name); |
245 uid_t getuid (void); | 190 uid_t getuid (void); |
246 uid_t geteuid (void); | 191 uid_t geteuid (void); |
247 gid_t getgid (void); | 192 gid_t getgid (void); |
248 gid_t getegid (void); | 193 gid_t getegid (void); |
194 | |
195 #if CYGWIN_VERSION_DLL_MAJOR <= 21 | |
196 #define _ftime ftime | |
249 #define _timeb timeb | 197 #define _timeb timeb |
198 #endif | |
250 | 199 |
251 /* Stuff that gets set wrongly or otherwise */ | 200 /* Stuff that gets set wrongly or otherwise */ |
252 #define HAVE_SETITIMER | 201 #define HAVE_SETITIMER |
253 #define HAVE_GETTIMEOFDAY | 202 #define HAVE_GETTIMEOFDAY |
254 #define HAVE_SELECT | 203 #define HAVE_SELECT |
204 /* systime.h includes winsock.h which defines timeval */ | |
205 #define HAVE_TIMEVAL | |
206 #define HAVE_GETPAGESIZE | |
207 #define getpagesize() 4096 | |
255 /*#define HAVE_STRUCT_UTIMBUF*/ | 208 /*#define HAVE_STRUCT_UTIMBUF*/ |
209 #ifndef HAVE_H_ERRNO | |
210 #define HAVE_H_ERRNO | |
211 #endif | |
212 #ifndef HAVE_TZNAME | |
213 #define HAVE_TZNAME | |
214 #endif | |
256 | 215 |
257 #undef GETTIMEOFDAY_ONE_ARGUMENT | 216 #undef GETTIMEOFDAY_ONE_ARGUMENT |
258 #undef HAVE_SYS_WAIT_H | 217 #undef HAVE_SYS_WAIT_H |
259 #undef HAVE_TERMIOS | 218 #undef HAVE_TERMIOS |
260 #undef SYSV_SYSTEM_DIR | 219 #undef SYSV_SYSTEM_DIR |
220 #undef CLASH_DETECTION | |
261 | 221 |
262 /* We now have emulation for some signals */ | 222 /* We now have emulation for some signals */ |
263 #define HAVE_SIGHOLD | 223 #define HAVE_SIGHOLD |
264 #define sigset(s,h) msw_sigset(s,h) | 224 #define sigset(s,h) mswindows_sigset(s,h) |
265 #define sighold(s) msw_sighold(s) | 225 #define sighold(s) mswindows_sighold(s) |
266 #define sigrelse(s) msw_sigrelse(s) | 226 #define sigrelse(s) mswindows_sigrelse(s) |
267 #define sigpause(s) msw_sigpause(s) | 227 #define sigpause(s) mswindows_sigpause(s) |
268 #define signal sigset | 228 #define signal sigset |
269 | 229 |
270 /* Defines that we need that aren't in the standard signal.h */ | 230 /* Defines that we need that aren't in the standard signal.h */ |
271 #define SIGHUP 1 /* Hang up */ | 231 #define SIGHUP 1 /* Hang up */ |
272 #define SIGQUIT 3 /* Quit process */ | 232 #define SIGQUIT 3 /* Quit process */ |
275 #define SIGPROF 29 /* Profiling timer exp */ | 235 #define SIGPROF 29 /* Profiling timer exp */ |
276 | 236 |
277 #ifndef MAXPATHLEN | 237 #ifndef MAXPATHLEN |
278 #define MAXPATHLEN _MAX_PATH | 238 #define MAXPATHLEN _MAX_PATH |
279 #endif | 239 #endif |
280 | 240 #endif /* !NOT_C_CODE */ |
281 /* For integration with MSDOS support. */ | |
282 #define getdisk() (_getdrive () - 1) | |
283 #define getdefdir(_drv, _buf) _getdcwd (_drv, _buf, MAXPATHLEN) | |
284 #endif | |
285 | 241 |
286 /* Define for those source files that do not include enough NT | 242 /* Define for those source files that do not include enough NT |
287 system files. */ | 243 system files. */ |
288 #ifndef NULL | 244 #ifndef NULL |
289 #ifdef __cplusplus | 245 #ifdef __cplusplus |
294 #endif | 250 #endif |
295 | 251 |
296 /* Define process implementation */ | 252 /* Define process implementation */ |
297 #define HAVE_WIN32_PROCESSES | 253 #define HAVE_WIN32_PROCESSES |
298 | 254 |
299 /* ============================================================ */ | 255 #define CORRECT_DIR_SEPS(s) \ |
300 | 256 do { if ('/' == DIRECTORY_SEP) dostounix_filename (s); \ |
257 else unixtodos_filename (s); \ | |
258 } while (0) |