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 /* translate NT world unexec stuff to our a.out definitions */
59 #define strnicmp strncasecmp
60 /* #ifndef HAVE_SOCKETS */
63 #define OBJECTS_SYSTEM ntplay.o nt.o ntheap.o ntproc.o dired-msw.o
64 #define HAVE_NATIVE_SOUND
66 #undef MAIL_USE_SYSTEM_LOCK
68 #define HAVE_MSW_C_DIRED
70 /* Define NO_ARG_ARRAY if you cannot take the address of the first of a
71 * group of arguments and treat it as an array of the arguments. */
75 /* Define WORD_MACHINE if addresses and such have
76 * to be corrected before they can be used as byte counts. */
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
84 If you use NO_UNION_TYPE, this flag does not matter. */
86 #define EXPLICIT_SIGN_EXTEND
87 /* System calls that are encapsulated */
88 #define ENCAPSULATE_RENAME
89 #define ENCAPSULATE_OPEN
90 #define ENCAPSULATE_FOPEN
91 #define ENCAPSULATE_MKDIR
93 /* Data type of load average, as read out of kmem. */
95 #define LOAD_AVE_TYPE long
97 /* Convert that into an integer that is 100 for a load average of 1.0 */
99 #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
101 /* Define VIRT_ADDR_VARIES if the virtual addresses of
102 pure and impure space as loaded can vary, and even their
103 relative order cannot be relied on.
105 Otherwise Emacs assumes that text space precedes data space,
108 /* Text does precede data space, but this is never a safe assumption. */
109 #define VIRT_ADDR_VARIES
111 /* set this if you have a new version of cygwin
112 #define DATA_SEG_BITS 0x10000000
115 /* If you are compiling with a non-C calling convention but need to
116 declare vararg routines differently, put it here */
117 #define _VARARGS_ __cdecl
119 /* If you are providing a function to something that will call the
120 function back (like a signal handler and signal, or main) its calling
121 convention must be whatever standard the libraries expect */
122 #define _CALLBACK_ __cdecl
124 /* SYSTEM_TYPE should indicate the kind of system you are using.
125 It sets the Lisp variable system-type. */
127 #define SYSTEM_TYPE "windows-nt"
131 /* define MAIL_USE_FLOCK if the mailer uses flock
132 to interlock access to /usr/spool/mail/$USER.
133 The alternative is that a lock file named
134 /usr/spool/mail/$USER.lock. */
136 /* If the character used to separate elements of the executable path
137 is not ':', #define this to be the appropriate character constant. */
140 /* ============================================================ */
142 /* Here, add any special hacks needed
143 to make Emacs work on this system. For example,
144 you might define certain system call names that don't
145 exist on your system, or that do different things on
146 your system and must be used only through an encapsulation
147 (Which you should place, by convention, in sysdep.c). */
149 /* Define this to be the separator between devices and paths */
150 #define DEVICE_SEP ':'
152 #define DIRECTORY_SEP '\\'
154 /* The null device on Windows NT. */
155 #define NULL_DEVICE "NUL:"
156 #define EXEC_SUFFIXES ".exe:.com:.bat:.cmd:"
157 /* We'll support either convention on NT. */
158 #define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\')
159 #define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_))
160 #define EXEC_SUFFIXES ".exe:.com:.bat:.cmd:"
162 /* We need a little extra space, see ../../lisp/loadup.el */
163 #define SYSTEM_PURESIZE_EXTRA 15000
167 #include <mingw32/process.h>
168 #define mkdir __mkdir
171 #ifdef HAVE_CYGWIN_VERSION_H
172 #include <cygwin/version.h>
175 typedef unsigned int MMRESULT;
176 typedef struct timecaps_tag {
177 unsigned int wPeriodMin;
178 unsigned int wPeriodMax;
181 /* IO calls that are emulated or shadowed */
182 #define pipe sys_pipe
183 int sys_pipe (int * phandles);
185 #ifndef HAVE_X_WINDOWS
186 #define sleep sys_sleep
187 void sleep (int seconds);
190 /* subprocess calls that are emulated */
191 #define spawnve sys_spawnve
192 int spawnve (int mode, CONST char *cmdname,
193 CONST char * CONST *argv, CONST char *CONST *envp);
195 #define wait sys_wait
196 int wait (int *status);
198 #define kill sys_kill
199 int kill (int pid, int sig);
201 /* map to MSVC names */
203 #define pclose _pclose
205 /* Encapsulation of system calls */
206 #ifndef DONT_ENCAPSULATE
207 #define getpid sys_getpid
211 #define DONT_USE_LITOUT
213 /* Random global functions called everywhere. Implemented in nt.c */
214 /* #### Most of these are FSFisms and must be avoided */
215 /* #### All of these are FSFisms and must be avoided */
216 void dostounix_filename (char *p);
217 void unixtodos_filename (char *p);
218 int crlf_to_lf (int n, unsigned char *buf, unsigned int *lf_count);
220 char *getwd (char *dir);
222 void *sbrk (unsigned long increment);
225 struct passwd *getpwuid (int uid);
226 struct passwd *getpwnam (const char *name);
233 /* Stuff that gets set wrongly or otherwise */
234 #define HAVE_SETITIMER
235 #define HAVE_GETTIMEOFDAY
237 /*#define HAVE_STRUCT_UTIMBUF*/
239 #undef GETTIMEOFDAY_ONE_ARGUMENT
240 #undef HAVE_SYS_WAIT_H
242 #undef SYSV_SYSTEM_DIR
244 /* We now have emulation for some signals */
246 #define sigset(s,h) msw_sigset(s,h)
247 #define sighold(s) msw_sighold(s)
248 #define sigrelse(s) msw_sigrelse(s)
249 #define sigpause(s) msw_sigpause(s)
250 #define signal sigset
252 /* Defines that we need that aren't in the standard signal.h */
253 #define SIGHUP 1 /* Hang up */
254 #define SIGQUIT 3 /* Quit process */
255 #define SIGKILL 9 /* Die, die die */
256 #define SIGALRM 14 /* Alarm */
257 #define SIGPROF 29 /* Profiling timer exp */
260 #define MAXPATHLEN _MAX_PATH
263 /* For integration with MSDOS support. */
264 #define getdisk() (_getdrive () - 1)
265 #define getdefdir(_drv, _buf) _getdcwd (_drv, _buf, MAXPATHLEN)
268 /* Define for those source files that do not include enough NT
274 #define NULL ((void *)0)
278 /* Define process implementation */
279 #define HAVE_WIN32_PROCESSES
281 /* ============================================================ */