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 /* System calls that are encapsulated */
89 #define ENCAPSULATE_RENAME
90 #define ENCAPSULATE_OPEN
91 #define ENCAPSULATE_FOPEN
92 #define ENCAPSULATE_MKDIR
94 /* Data type of load average, as read out of kmem. */
96 #define LOAD_AVE_TYPE long
98 /* Convert that into an integer that is 100 for a load average of 1.0 */
100 #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
102 /* Define VIRT_ADDR_VARIES if the virtual addresses of
103 pure and impure space as loaded can vary, and even their
104 relative order cannot be relied on.
106 Otherwise Emacs assumes that text space precedes data space,
109 /* Text does precede data space, but this is never a safe assumption. */
110 #define VIRT_ADDR_VARIES
112 /* If you are compiling with a non-C calling convention but need to
113 declare vararg routines differently, put it here */
114 #define _VARARGS_ __cdecl
116 /* If you are providing a function to something that will call the
117 function back (like a signal handler and signal, or main) its calling
118 convention must be whatever standard the libraries expect */
119 #define _CALLBACK_ __cdecl
121 /* SYSTEM_TYPE should indicate the kind of system you are using.
122 It sets the Lisp variable system-type. */
124 #define SYSTEM_TYPE "windows-nt"
128 /* define MAIL_USE_FLOCK if the mailer uses flock
129 to interlock access to /usr/spool/mail/$USER.
130 The alternative is that a lock file named
131 /usr/spool/mail/$USER.lock. */
133 /* If the character used to separate elements of the executable path
134 is not ':', #define this to be the appropriate character constant. */
137 /* ============================================================ */
139 /* Here, add any special hacks needed
140 to make Emacs work on this system. For example,
141 you might define certain system call names that don't
142 exist on your system, or that do different things on
143 your system and must be used only through an encapsulation
144 (Which you should place, by convention, in sysdep.c). */
146 /* Define this to be the separator between devices and paths */
147 #define DEVICE_SEP ':'
149 #define DIRECTORY_SEP '\\'
151 /* The null device on Windows NT. */
152 #define NULL_DEVICE "NUL:"
153 #define EXEC_SUFFIXES ".exe:.com:.bat:.cmd:"
154 /* We'll support either convention on NT. */
155 #define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\')
156 #define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_))
157 #define EXEC_SUFFIXES ".exe:.com:.bat:.cmd:"
159 /* We need a little extra space, see ../../lisp/loadup.el */
160 #define SYSTEM_PURESIZE_EXTRA 15000
164 #include <mingw32/process.h>
165 #define mkdir __mkdir
168 #ifdef HAVE_CYGWIN_VERSION_H
169 #include <cygwin/version.h>
172 typedef unsigned int MMRESULT;
173 typedef struct timecaps_tag {
174 unsigned int wPeriodMin;
175 unsigned int wPeriodMax;
178 /* IO calls that are emulated or shadowed */
179 #define pipe sys_pipe
180 int sys_pipe (int * phandles);
182 #ifndef HAVE_X_WINDOWS
183 #define sleep sys_sleep
184 void sleep (int seconds);
187 /* subprocess calls that are emulated */
188 #define spawnve sys_spawnve
189 int spawnve (int mode, const char *cmdname,
190 const char * const *argv, const char *const *envp);
192 #define wait sys_wait
193 int wait (int *status);
195 #define kill sys_kill
196 int kill (int pid, int sig);
198 /* map to MSVC names */
200 #define pclose _pclose
207 /* Encapsulation of system calls */
208 #ifndef DONT_ENCAPSULATE
209 #define getpid sys_getpid
213 #define DONT_USE_LITOUT
215 /* Random global functions called everywhere. Implemented in nt.c */
216 /* #### Most of these are FSFisms and must be avoided */
217 /* #### All of these are FSFisms and must be avoided */
218 void dostounix_filename (char *p);
219 void unixtodos_filename (char *p);
220 int crlf_to_lf (int n, unsigned char *buf, unsigned int *lf_count);
222 char *getwd (char *dir);
224 void *sbrk (unsigned long increment);
227 struct passwd *getpwuid (uid_t uid);
228 struct passwd *getpwnam (const char *name);
230 uid_t geteuid (void);
232 gid_t getegid (void);
235 /* Stuff that gets set wrongly or otherwise */
236 #define HAVE_SETITIMER
237 #define HAVE_GETTIMEOFDAY
239 /*#define HAVE_STRUCT_UTIMBUF*/
241 #undef GETTIMEOFDAY_ONE_ARGUMENT
242 #undef HAVE_SYS_WAIT_H
244 #undef SYSV_SYSTEM_DIR
246 /* We now have emulation for some signals */
248 #define sigset(s,h) msw_sigset(s,h)
249 #define sighold(s) msw_sighold(s)
250 #define sigrelse(s) msw_sigrelse(s)
251 #define sigpause(s) msw_sigpause(s)
252 #define signal sigset
254 /* Defines that we need that aren't in the standard signal.h */
255 #define SIGHUP 1 /* Hang up */
256 #define SIGQUIT 3 /* Quit process */
257 #define SIGKILL 9 /* Die, die die */
258 #define SIGALRM 14 /* Alarm */
259 #define SIGPROF 29 /* Profiling timer exp */
262 #define MAXPATHLEN _MAX_PATH
265 /* For integration with MSDOS support. */
266 #define getdisk() (_getdrive () - 1)
267 #define getdefdir(_drv, _buf) _getdcwd (_drv, _buf, MAXPATHLEN)
270 /* Define for those source files that do not include enough NT
276 #define NULL ((void *)0)
280 /* Define process implementation */
281 #define HAVE_WIN32_PROCESSES
283 /* ============================================================ */