1 /* system description file for mingw32.
2 Copyright (C) 1993, 1994, 1995, 1999 Free Software Foundation, Inc.
4 This file is part of GNU Emacs.
6 GNU Emacs is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 GNU Emacs is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with XEmacs; see the file COPYING. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 /* based on cygwin32.h by Andy Piper <andy@xemacs.org> */
28 #define DOS_NT /* MSDOS or WINDOWSNT */
31 #define PBS_SMOOTH 0x01
33 #ifdef HAVE_MS_WINDOWS
42 #define C_SWITCH_SYSTEM "-mno-cygwin -Wno-sign-compare -fno-caller-saves -Int/inc -I../nt/inc -DWINDOWSNT"
43 #define LIBS_SYSTEM "-mno-cygwin -lwinmm -lwsock32"
49 #define UNEXEC "unexcw.o"
51 #define TIME_ONESHOT 0
52 #define TIME_PERIODIC 1
53 #define LOCALE_USE_CP_ACP 0x40000000
54 #define SHGFI_EXETYPE 0x2000
57 #ifndef SPI_GETWHEELSCROLLLINES
58 #define SPI_GETWHEELSCROLLLINES 104
60 #ifndef WHEEL_PAGESCROLL
61 #define WHEEL_PAGESCROLL (UINT_MAX)
64 #define WHEEL_DELTA 120
67 #define WM_MOUSEWHEEL 0x20A
70 /* translate NT world unexec stuff to our a.out definitions */
72 #define strnicmp strncasecmp
73 /* #ifndef HAVE_SOCKETS */
76 #define OBJECTS_SYSTEM ntplay.o nt.o ntheap.o ntproc.o dired-msw.o
77 #define HAVE_NATIVE_SOUND
79 #undef MAIL_USE_SYSTEM_LOCK
81 #define HAVE_MSW_C_DIRED
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. */
88 /* Define WORD_MACHINE if addresses and such have
89 * to be corrected before they can be used as byte counts. */
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
97 If you use NO_UNION_TYPE, this flag does not matter. */
99 #define EXPLICIT_SIGN_EXTEND
100 /* System calls that are encapsulated */
101 #define ENCAPSULATE_RENAME
102 #define ENCAPSULATE_OPEN
103 #define ENCAPSULATE_FOPEN
104 #define ENCAPSULATE_MKDIR
106 /* Data type of load average, as read out of kmem. */
108 #define LOAD_AVE_TYPE long
110 /* Convert that into an integer that is 100 for a load average of 1.0 */
112 #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
114 /* Define VIRT_ADDR_VARIES if the virtual addresses of
115 pure and impure space as loaded can vary, and even their
116 relative order cannot be relied on.
118 Otherwise Emacs assumes that text space precedes data space,
121 /* Text does precede data space, but this is never a safe assumption. */
122 #define VIRT_ADDR_VARIES
124 /* set this if you have a new version of cygwin
125 #define DATA_SEG_BITS 0x10000000
128 /* If you are compiling with a non-C calling convention but need to
129 declare vararg routines differently, put it here */
130 #define _VARARGS_ __cdecl
132 /* If you are providing a function to something that will call the
133 function back (like a signal handler and signal, or main) its calling
134 convention must be whatever standard the libraries expect */
135 #define _CALLBACK_ __cdecl
137 /* SYSTEM_TYPE should indicate the kind of system you are using.
138 It sets the Lisp variable system-type. */
140 #define SYSTEM_TYPE "windows-nt"
144 /* define MAIL_USE_FLOCK if the mailer uses flock
145 to interlock access to /usr/spool/mail/$USER.
146 The alternative is that a lock file named
147 /usr/spool/mail/$USER.lock. */
149 /* If the character used to separate elements of the executable path
150 is not ':', #define this to be the appropriate character constant. */
153 /* ============================================================ */
155 /* Here, add any special hacks needed
156 to make Emacs work on this system. For example,
157 you might define certain system call names that don't
158 exist on your system, or that do different things on
159 your system and must be used only through an encapsulation
160 (Which you should place, by convention, in sysdep.c). */
162 /* Define this to be the separator between devices and paths */
163 #define DEVICE_SEP ':'
165 #define DIRECTORY_SEP '\\'
167 /* The null device on Windows NT. */
168 #define NULL_DEVICE "NUL:"
169 #define EXEC_SUFFIXES ".exe:.com:.bat:.cmd:"
170 /* We'll support either convention on NT. */
171 #define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\')
172 #define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_))
173 #define EXEC_SUFFIXES ".exe:.com:.bat:.cmd:"
175 /* We need a little extra space, see ../../lisp/loadup.el */
176 #define SYSTEM_PURESIZE_EXTRA 15000
180 #include <mingw32/process.h>
181 #define mkdir __mkdir
184 #ifdef HAVE_CYGWIN_VERSION_H
185 #include <cygwin/version.h>
188 typedef unsigned int MMRESULT;
189 typedef struct timecaps_tag {
190 unsigned int wPeriodMin;
191 unsigned int wPeriodMax;
194 /* IO calls that are emulated or shadowed */
195 #define pipe sys_pipe
196 int sys_pipe (int * phandles);
198 #ifndef HAVE_X_WINDOWS
199 #define sleep sys_sleep
200 void sleep (int seconds);
203 /* subprocess calls that are emulated */
204 #define spawnve sys_spawnve
205 int spawnve (int mode, CONST char *cmdname,
206 CONST char * CONST *argv, CONST char *CONST *envp);
208 #define wait sys_wait
209 int wait (int *status);
211 #define kill sys_kill
212 int kill (int pid, int sig);
214 /* map to MSVC names */
216 #define pclose _pclose
223 /* Encapsulation of system calls */
224 #ifndef DONT_ENCAPSULATE
225 #define getpid sys_getpid
229 #define DONT_USE_LITOUT
231 /* Random global functions called everywhere. Implemented in nt.c */
232 /* #### Most of these are FSFisms and must be avoided */
233 /* #### All of these are FSFisms and must be avoided */
234 void dostounix_filename (char *p);
235 void unixtodos_filename (char *p);
236 int crlf_to_lf (int n, unsigned char *buf, unsigned int *lf_count);
238 char *getwd (char *dir);
240 void *sbrk (unsigned long increment);
243 struct passwd *getpwuid (uid_t uid);
244 struct passwd *getpwnam (const char *name);
246 uid_t geteuid (void);
248 gid_t getegid (void);
251 /* Stuff that gets set wrongly or otherwise */
252 #define HAVE_SETITIMER
253 #define HAVE_GETTIMEOFDAY
255 /*#define HAVE_STRUCT_UTIMBUF*/
257 #undef GETTIMEOFDAY_ONE_ARGUMENT
258 #undef HAVE_SYS_WAIT_H
260 #undef SYSV_SYSTEM_DIR
262 /* We now have emulation for some signals */
264 #define sigset(s,h) msw_sigset(s,h)
265 #define sighold(s) msw_sighold(s)
266 #define sigrelse(s) msw_sigrelse(s)
267 #define sigpause(s) msw_sigpause(s)
268 #define signal sigset
270 /* Defines that we need that aren't in the standard signal.h */
271 #define SIGHUP 1 /* Hang up */
272 #define SIGQUIT 3 /* Quit process */
273 #define SIGKILL 9 /* Die, die die */
274 #define SIGALRM 14 /* Alarm */
275 #define SIGPROF 29 /* Profiling timer exp */
278 #define MAXPATHLEN _MAX_PATH
281 /* For integration with MSDOS support. */
282 #define getdisk() (_getdrive () - 1)
283 #define getdefdir(_drv, _buf) _getdcwd (_drv, _buf, MAXPATHLEN)
286 /* Define for those source files that do not include enough NT
292 #define NULL ((void *)0)
296 /* Define process implementation */
297 #define HAVE_WIN32_PROCESSES
299 /* ============================================================ */