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"
42 #define WIN32_LEAN_AND_MEAN
48 #define UNEXEC "unexcw.o"
50 #define TIME_ONESHOT 0
51 #define TIME_PERIODIC 1
52 #define LOCALE_USE_CP_ACP 0x40000000
55 /* this is necessary to get the TCS_* definitions in <commctrl.h> */
56 #define _WIN32_IE 0x0400
58 /* translate NT world unexec stuff to our a.out definitions */
60 #define strnicmp strncasecmp
61 /* #ifndef HAVE_SOCKETS */
64 #define OBJECTS_SYSTEM ntplay.o nt.o ntheap.o ntproc.o dired-msw.o
65 #define HAVE_NATIVE_SOUND
67 #undef MAIL_USE_SYSTEM_LOCK
69 #define HAVE_MSW_C_DIRED
71 /* Define NO_ARG_ARRAY if you cannot take the address of the first of a
72 * group of arguments and treat it as an array of the arguments. */
76 /* System calls that are encapsulated */
77 #define ENCAPSULATE_RENAME
78 #define ENCAPSULATE_OPEN
79 #define ENCAPSULATE_FOPEN
80 #define ENCAPSULATE_MKDIR
82 /* Data type of load average, as read out of kmem. */
84 #define LOAD_AVE_TYPE long
86 /* Convert that into an integer that is 100 for a load average of 1.0 */
88 #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
90 /* Define VIRT_ADDR_VARIES if the virtual addresses of
91 pure and impure space as loaded can vary, and even their
92 relative order cannot be relied on.
94 Otherwise Emacs assumes that text space precedes data space,
97 /* Text does precede data space, but this is never a safe assumption. */
98 #define VIRT_ADDR_VARIES
100 /* If you are compiling with a non-C calling convention but need to
101 declare vararg routines differently, put it here */
102 #define _VARARGS_ __cdecl
104 /* If you are providing a function to something that will call the
105 function back (like a signal handler and signal, or main) its calling
106 convention must be whatever standard the libraries expect */
107 #define _CALLBACK_ __cdecl
109 /* SYSTEM_TYPE should indicate the kind of system you are using.
110 It sets the Lisp variable system-type. */
112 #define SYSTEM_TYPE "windows-nt"
116 /* define MAIL_USE_FLOCK if the mailer uses flock
117 to interlock access to /usr/spool/mail/$USER.
118 The alternative is that a lock file named
119 /usr/spool/mail/$USER.lock. */
121 /* If the character used to separate elements of the executable path
122 is not ':', #define this to be the appropriate character constant. */
125 /* ============================================================ */
127 /* Here, add any special hacks needed
128 to make Emacs work on this system. For example,
129 you might define certain system call names that don't
130 exist on your system, or that do different things on
131 your system and must be used only through an encapsulation
132 (Which you should place, by convention, in sysdep.c). */
134 /* Define this to be the separator between devices and paths */
135 #define DEVICE_SEP ':'
137 #define DIRECTORY_SEP '\\'
139 /* The null device on Windows NT. */
140 #define NULL_DEVICE "NUL:"
141 #define EXEC_SUFFIXES ".exe:.com:.bat:.cmd:"
142 /* We'll support either convention on NT. */
143 #define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\')
144 #define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_))
145 #define EXEC_SUFFIXES ".exe:.com:.bat:.cmd:"
147 /* We need a little extra space, see ../../lisp/loadup.el */
148 #define SYSTEM_PURESIZE_EXTRA 15000
152 #include <mingw32/process.h>
153 #define mkdir __mkdir
156 #ifdef HAVE_CYGWIN_VERSION_H
157 #include <cygwin/version.h>
160 /* IO calls that are emulated or shadowed */
161 #define pipe sys_pipe
162 int sys_pipe (int * phandles);
164 #ifndef HAVE_X_WINDOWS
165 #define sleep sys_sleep
166 void sleep (int seconds);
169 /* subprocess calls that are emulated */
170 #define spawnve sys_spawnve
171 int spawnve (int mode, const char *cmdname,
172 const char * const *argv, const char *const *envp);
174 #define wait sys_wait
175 int wait (int *status);
177 #define kill sys_kill
178 int kill (int pid, int sig);
180 /* map to MSVC names */
182 #define pclose _pclose
184 /* Encapsulation of system calls */
185 #ifndef DONT_ENCAPSULATE
186 #define getpid sys_getpid
190 #define DONT_USE_LITOUT
192 /* Random global functions called everywhere. Implemented in nt.c */
193 /* #### Most of these are FSFisms and must be avoided */
194 /* #### All of these are FSFisms and must be avoided */
195 void dostounix_filename (char *p);
196 void unixtodos_filename (char *p);
197 int crlf_to_lf (int n, unsigned char *buf, unsigned int *lf_count);
199 char *getwd (char *dir);
201 void *sbrk (unsigned long increment);
204 struct passwd *getpwuid (uid_t uid);
205 struct passwd *getpwnam (const char *name);
207 uid_t geteuid (void);
209 gid_t getegid (void);
211 #if CYGWIN_VERSION_DLL_MAJOR <= 21
216 /* Stuff that gets set wrongly or otherwise */
217 #define HAVE_SETITIMER
218 #define HAVE_GETTIMEOFDAY
220 /*#define HAVE_STRUCT_UTIMBUF*/
228 #undef GETTIMEOFDAY_ONE_ARGUMENT
229 #undef HAVE_SYS_WAIT_H
231 #undef SYSV_SYSTEM_DIR
232 #undef CLASH_DETECTION
234 /* We now have emulation for some signals */
236 #define sigset(s,h) msw_sigset(s,h)
237 #define sighold(s) msw_sighold(s)
238 #define sigrelse(s) msw_sigrelse(s)
239 #define sigpause(s) msw_sigpause(s)
240 #define signal sigset
242 /* Defines that we need that aren't in the standard signal.h */
243 #define SIGHUP 1 /* Hang up */
244 #define SIGQUIT 3 /* Quit process */
245 #define SIGKILL 9 /* Die, die die */
246 #define SIGALRM 14 /* Alarm */
247 #define SIGPROF 29 /* Profiling timer exp */
250 #define MAXPATHLEN _MAX_PATH
253 /* For integration with MSDOS support. */
254 #define getdisk() (_getdrive () - 1)
255 #define getdefdir(_drv, _buf) _getdcwd (_drv, _buf, MAXPATHLEN)
258 /* Define for those source files that do not include enough NT
264 #define NULL ((void *)0)
268 /* Define process implementation */
269 #define HAVE_WIN32_PROCESSES
271 /* ============================================================ */