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 #ifdef HAVE_MS_WINDOWS
40 #define C_SWITCH_SYSTEM "-mno-cygwin -Wno-sign-compare -fno-caller-saves -Int/inc -I../nt/inc -DWINDOWSNT"
41 #define LIBS_SYSTEM "-mno-cygwin -lwinmm -lwsock32"
47 #define UNEXEC "unexcw.o"
49 #define TIME_ONESHOT 0
50 #define TIME_PERIODIC 1
51 #define LOCALE_USE_CP_ACP 0x40000000
54 #ifndef SPI_GETWHEELSCROLLLINES
55 #define SPI_GETWHEELSCROLLLINES 104
57 #ifndef WHEEL_PAGESCROLL
58 #define WHEEL_PAGESCROLL (UINT_MAX)
61 #define WHEEL_DELTA 120
64 /* this is necessary to get the TCS_* definitions in <commctrl.h> */
65 #define _WIN32_IE 0x0400
68 #define WM_MOUSEWHEEL 0x20A
71 #define TCS_BOTTOM 0x0002
74 #define TCS_VERTICAL 0x0080
77 #define PHYSICALWIDTH 110
79 #ifndef PHYSICALHEIGHT
80 #define PHYSICALHEIGHT 111
82 #ifndef PHYSICALOFFSETX
83 #define PHYSICALOFFSETX 112
85 #ifndef PHYSICALOFFSETY
86 #define PHYSICALOFFSETY 113
89 #define PBS_SMOOTH 0x01
92 /* translate NT world unexec stuff to our a.out definitions */
94 #define strnicmp strncasecmp
95 /* #ifndef HAVE_SOCKETS */
98 #define OBJECTS_SYSTEM ntplay.o nt.o ntheap.o ntproc.o dired-msw.o
99 #define HAVE_NATIVE_SOUND
101 #undef MAIL_USE_SYSTEM_LOCK
103 #define HAVE_MSW_C_DIRED
105 /* Define NO_ARG_ARRAY if you cannot take the address of the first of a
106 * group of arguments and treat it as an array of the arguments. */
110 /* System calls that are encapsulated */
111 #define ENCAPSULATE_RENAME
112 #define ENCAPSULATE_OPEN
113 #define ENCAPSULATE_FOPEN
114 #define ENCAPSULATE_MKDIR
116 /* Data type of load average, as read out of kmem. */
118 #define LOAD_AVE_TYPE long
120 /* Convert that into an integer that is 100 for a load average of 1.0 */
122 #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
124 /* Define VIRT_ADDR_VARIES if the virtual addresses of
125 pure and impure space as loaded can vary, and even their
126 relative order cannot be relied on.
128 Otherwise Emacs assumes that text space precedes data space,
131 /* Text does precede data space, but this is never a safe assumption. */
132 #define VIRT_ADDR_VARIES
134 /* If you are compiling with a non-C calling convention but need to
135 declare vararg routines differently, put it here */
136 #define _VARARGS_ __cdecl
138 /* If you are providing a function to something that will call the
139 function back (like a signal handler and signal, or main) its calling
140 convention must be whatever standard the libraries expect */
141 #define _CALLBACK_ __cdecl
143 /* SYSTEM_TYPE should indicate the kind of system you are using.
144 It sets the Lisp variable system-type. */
146 #define SYSTEM_TYPE "windows-nt"
150 /* define MAIL_USE_FLOCK if the mailer uses flock
151 to interlock access to /usr/spool/mail/$USER.
152 The alternative is that a lock file named
153 /usr/spool/mail/$USER.lock. */
155 /* If the character used to separate elements of the executable path
156 is not ':', #define this to be the appropriate character constant. */
159 /* ============================================================ */
161 /* Here, add any special hacks needed
162 to make Emacs work on this system. For example,
163 you might define certain system call names that don't
164 exist on your system, or that do different things on
165 your system and must be used only through an encapsulation
166 (Which you should place, by convention, in sysdep.c). */
168 /* Define this to be the separator between devices and paths */
169 #define DEVICE_SEP ':'
171 #define DIRECTORY_SEP '\\'
173 /* The null device on Windows NT. */
174 #define NULL_DEVICE "NUL:"
175 #define EXEC_SUFFIXES ".exe:.com:.bat:.cmd:"
176 /* We'll support either convention on NT. */
177 #define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\')
178 #define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_))
179 #define EXEC_SUFFIXES ".exe:.com:.bat:.cmd:"
181 /* We need a little extra space, see ../../lisp/loadup.el */
182 #define SYSTEM_PURESIZE_EXTRA 15000
186 #include <mingw32/process.h>
187 #define mkdir __mkdir
190 #ifdef HAVE_CYGWIN_VERSION_H
191 #include <cygwin/version.h>
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
218 /* Encapsulation of system calls */
219 #ifndef DONT_ENCAPSULATE
220 #define getpid sys_getpid
224 #define DONT_USE_LITOUT
226 /* Random global functions called everywhere. Implemented in nt.c */
227 /* #### Most of these are FSFisms and must be avoided */
228 /* #### All of these are FSFisms and must be avoided */
229 void dostounix_filename (char *p);
230 void unixtodos_filename (char *p);
231 int crlf_to_lf (int n, unsigned char *buf, unsigned int *lf_count);
233 char *getwd (char *dir);
235 void *sbrk (unsigned long increment);
238 struct passwd *getpwuid (uid_t uid);
239 struct passwd *getpwnam (const char *name);
241 uid_t geteuid (void);
243 gid_t getegid (void);
245 #if CYGWIN_VERSION_DLL_MAJOR <= 21
250 /* Stuff that gets set wrongly or otherwise */
251 #define HAVE_SETITIMER
252 #define HAVE_GETTIMEOFDAY
254 /*#define HAVE_STRUCT_UTIMBUF*/
262 #undef GETTIMEOFDAY_ONE_ARGUMENT
263 #undef HAVE_SYS_WAIT_H
265 #undef SYSV_SYSTEM_DIR
267 /* We now have emulation for some signals */
269 #define sigset(s,h) msw_sigset(s,h)
270 #define sighold(s) msw_sighold(s)
271 #define sigrelse(s) msw_sigrelse(s)
272 #define sigpause(s) msw_sigpause(s)
273 #define signal sigset
275 /* Defines that we need that aren't in the standard signal.h */
276 #define SIGHUP 1 /* Hang up */
277 #define SIGQUIT 3 /* Quit process */
278 #define SIGKILL 9 /* Die, die die */
279 #define SIGALRM 14 /* Alarm */
280 #define SIGPROF 29 /* Profiling timer exp */
283 #define MAXPATHLEN _MAX_PATH
286 /* For integration with MSDOS support. */
287 #define getdisk() (_getdrive () - 1)
288 #define getdefdir(_drv, _buf) _getdcwd (_drv, _buf, MAXPATHLEN)
291 /* Define for those source files that do not include enough NT
297 #define NULL ((void *)0)
301 /* Define process implementation */
302 #define HAVE_WIN32_PROCESSES
304 /* ============================================================ */