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> */
23 /* Identify ourselves */
34 #define C_SWITCH_SYSTEM "-mno-cygwin -Wno-sign-compare -fno-caller-saves -DWIN32_NATIVE"
35 #define LIBS_SYSTEM "-mno-cygwin -mwindows -lwinmm -lwsock32"
36 #define WIN32_LEAN_AND_MEAN
42 #define UNEXEC "unexcw.o"
44 #define TIME_ONESHOT 0
45 #define TIME_PERIODIC 1
46 #define LOCALE_USE_CP_ACP 0x40000000
49 /* this is necessary to get the TCS_* definitions in <commctrl.h> */
50 #define _WIN32_IE 0x0400
52 /* translate NT world unexec stuff to our a.out definitions */
54 #define strnicmp strncasecmp
55 /* #ifndef HAVE_SOCKETS */
58 #define OBJECTS_SYSTEM ntplay.o nt.o ntheap.o ntproc.o dired-msw.o
60 #undef MAIL_USE_SYSTEM_LOCK
61 #define HAVE_MSW_C_DIRED
63 /* Define NO_ARG_ARRAY if you cannot take the address of the first of a
64 * group of arguments and treat it as an array of the arguments. */
68 /* System calls that are encapsulated */
69 #define ENCAPSULATE_RENAME
70 #define ENCAPSULATE_OPEN
71 #define ENCAPSULATE_FOPEN
72 #define ENCAPSULATE_MKDIR
73 #define ENCAPSULATE_STAT
74 #define ENCAPSULATE_FSTAT
76 /* Data type of load average, as read out of kmem. */
78 #define LOAD_AVE_TYPE long
80 /* Convert that into an integer that is 100 for a load average of 1.0 */
82 #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
84 /* Define VIRT_ADDR_VARIES if the virtual addresses of
85 pure and impure space as loaded can vary, and even their
86 relative order cannot be relied on.
88 Otherwise Emacs assumes that text space precedes data space,
91 /* Text does precede data space, but this is never a safe assumption. */
92 #define VIRT_ADDR_VARIES
94 /* If you are compiling with a non-C calling convention but need to
95 declare vararg routines differently, put it here */
96 #define _VARARGS_ __cdecl
98 /* If you are providing a function to something that will call the
99 function back (like a signal handler and signal, or main) its calling
100 convention must be whatever standard the libraries expect */
101 #define _CALLBACK_ __cdecl
103 /* SYSTEM_TYPE should indicate the kind of system you are using.
104 It sets the Lisp variable system-type. */
106 #define SYSTEM_TYPE "windows-nt"
110 /* define MAIL_USE_FLOCK if the mailer uses flock
111 to interlock access to /usr/spool/mail/$USER.
112 The alternative is that a lock file named
113 /usr/spool/mail/$USER.lock. */
115 /* If the character used to separate elements of the executable path
116 is not ':', #define this to be the appropriate character constant. */
119 /* ============================================================ */
121 /* Here, add any special hacks needed
122 to make Emacs work on this system. For example,
123 you might define certain system call names that don't
124 exist on your system, or that do different things on
125 your system and must be used only through an encapsulation
126 (Which you should place, by convention, in sysdep.c). */
128 /* Define this to be the separator between devices and paths */
129 #define DEVICE_SEP ':'
131 #define DIRECTORY_SEP ((char)XCHAR(Vdirectory_sep_char))
133 /* The null device on Windows NT. */
134 #define NULL_DEVICE "NUL:"
135 #define EXEC_SUFFIXES ".exe:.com:.bat:.cmd:"
136 /* We'll support either convention on NT. */
137 #define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\')
138 #define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_))
139 #define EXEC_SUFFIXES ".exe:.com:.bat:.cmd:"
141 /* We need a little extra space, see ../../lisp/loadup.el */
142 #define SYSTEM_PURESIZE_EXTRA 15000
146 #include <mingw32/process.h>
147 #define mkdir __mkdir
150 #ifdef HAVE_CYGWIN_VERSION_H
151 #include <cygwin/version.h>
154 /* IO calls that are emulated or shadowed */
155 #define pipe sys_pipe
156 int sys_pipe (int * phandles);
158 #ifndef HAVE_X_WINDOWS
159 #define sleep sys_sleep
160 void sleep (int seconds);
163 /* subprocess calls that are emulated */
164 #define spawnve sys_spawnve
165 int spawnve (int mode, const char *cmdname,
166 const char * const *argv, const char *const *envp);
168 #define wait sys_wait
169 int wait (int *status);
171 #define kill sys_kill
172 int kill (int pid, int sig);
174 /* map to MSVC names */
176 #define pclose _pclose
178 /* Encapsulation of system calls */
179 #ifndef DONT_ENCAPSULATE
180 #define getpid sys_getpid
184 #define DONT_USE_LITOUT
186 /* Random global functions called everywhere. Implemented in nt.c */
187 /* #### Most of these are FSFisms and must be avoided */
188 /* #### All of these are FSFisms and must be avoided */
189 void dostounix_filename (char *p);
190 void unixtodos_filename (char *p);
191 int crlf_to_lf (int n, unsigned char *buf, unsigned int *lf_count);
193 char *getwd (char *dir);
195 void *sbrk (unsigned long increment);
198 struct passwd *getpwuid (uid_t uid);
199 struct passwd *getpwnam (const char *name);
201 uid_t geteuid (void);
203 gid_t getegid (void);
205 #if CYGWIN_VERSION_DLL_MAJOR <= 21
210 /* Stuff that gets set wrongly or otherwise */
211 #define HAVE_SETITIMER
212 #define HAVE_GETTIMEOFDAY
214 /* systime.h includes winsock.h which defines timeval */
216 #define HAVE_GETPAGESIZE
217 #define getpagesize() 4096
218 /*#define HAVE_STRUCT_UTIMBUF*/
226 #undef GETTIMEOFDAY_ONE_ARGUMENT
227 #undef HAVE_SYS_WAIT_H
229 #undef SYSV_SYSTEM_DIR
230 #undef CLASH_DETECTION
232 /* We now have emulation for some signals */
234 #define sigset(s,h) mswindows_sigset(s,h)
235 #define sighold(s) mswindows_sighold(s)
236 #define sigrelse(s) mswindows_sigrelse(s)
237 #define sigpause(s) mswindows_sigpause(s)
238 #define signal sigset
240 /* Defines that we need that aren't in the standard signal.h */
241 #define SIGHUP 1 /* Hang up */
242 #define SIGQUIT 3 /* Quit process */
243 #define SIGKILL 9 /* Die, die die */
244 #define SIGALRM 14 /* Alarm */
245 #define SIGPROF 29 /* Profiling timer exp */
248 #define MAXPATHLEN _MAX_PATH
250 #endif /* !NOT_C_CODE */
252 /* Define for those source files that do not include enough NT
258 #define NULL ((void *)0)
262 /* Define process implementation */
263 #define HAVE_WIN32_PROCESSES
265 #define CORRECT_DIR_SEPS(s) \
266 do { if ('/' == DIRECTORY_SEP) dostounix_filename (s); \
267 else unixtodos_filename (s); \