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 /* System calls that are encapsulated */
64 #define ENCAPSULATE_RENAME
65 #define ENCAPSULATE_OPEN
66 #define ENCAPSULATE_FOPEN
67 #define ENCAPSULATE_MKDIR
68 #define ENCAPSULATE_STAT
69 #define ENCAPSULATE_FSTAT
71 /* Do not define LOAD_AVE_TYPE or LOAD_AVE_CVT
72 since there is no load average available. */
74 /* Define VIRT_ADDR_VARIES if the virtual addresses of
75 pure and impure space as loaded can vary, and even their
76 relative order cannot be relied on.
78 Otherwise Emacs assumes that text space precedes data space,
81 /* Text does precede data space, but this is never a safe assumption. */
82 #define VIRT_ADDR_VARIES
84 /* If you are compiling with a non-C calling convention but need to
85 declare vararg routines differently, put it here */
86 #define _VARARGS_ __cdecl
88 /* If you are providing a function to something that will call the
89 function back (like a signal handler and signal, or main) its calling
90 convention must be whatever standard the libraries expect */
91 #define _CALLBACK_ __cdecl
93 /* SYSTEM_TYPE should indicate the kind of system you are using.
94 It sets the Lisp variable system-type. */
96 #define SYSTEM_TYPE "windows-nt"
100 /* define MAIL_USE_FLOCK if the mailer uses flock
101 to interlock access to /usr/spool/mail/$USER.
102 The alternative is that a lock file named
103 /usr/spool/mail/$USER.lock. */
105 /* If the character used to separate elements of the executable path
106 is not ':', #define this to be the appropriate character constant. */
109 /* ============================================================ */
111 /* Here, add any special hacks needed
112 to make Emacs work on this system. For example,
113 you might define certain system call names that don't
114 exist on your system, or that do different things on
115 your system and must be used only through an encapsulation
116 (Which you should place, by convention, in sysdep.c). */
118 /* Define this to be the separator between devices and paths */
119 #define DEVICE_SEP ':'
121 #define DIRECTORY_SEP ((char)XCHAR(Vdirectory_sep_char))
123 /* The null device on Windows NT. */
124 #define NULL_DEVICE "NUL:"
125 #define EXEC_SUFFIXES ".exe:.com:.bat:.cmd:"
126 /* We'll support either convention on NT. */
127 #define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\')
128 #define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_))
129 #define EXEC_SUFFIXES ".exe:.com:.bat:.cmd:"
131 /* We need a little extra space, see ../../lisp/loadup.el */
132 #define SYSTEM_PURESIZE_EXTRA 15000
136 #include <../mingw/process.h>
137 #define mkdir __mkdir
141 /* IO calls that are emulated or shadowed */
142 #define pipe sys_pipe
143 int sys_pipe (int * phandles);
145 #ifndef HAVE_X_WINDOWS
146 #define sleep sys_sleep
147 void sleep (int seconds);
150 /* subprocess calls that are emulated */
151 #define spawnve sys_spawnve
152 int spawnve (int mode, const char *cmdname,
153 const char * const *argv, const char *const *envp);
155 #define wait sys_wait
156 int wait (int *status);
158 #define kill sys_kill
159 int kill (int pid, int sig);
161 /* map to MSVC names */
163 #define pclose _pclose
165 /* Encapsulation of system calls */
166 #ifndef DONT_ENCAPSULATE
167 #define getpid sys_getpid
171 #define DONT_USE_LITOUT
173 /* Random global functions called everywhere. Implemented in nt.c */
174 /* #### Most of these are FSFisms and must be avoided */
175 /* #### All of these are FSFisms and must be avoided */
176 void dostounix_filename (char *p);
177 void unixtodos_filename (char *p);
178 int crlf_to_lf (int n, unsigned char *buf, unsigned int *lf_count);
180 char *getwd (char *dir);
182 void *sbrk (unsigned long increment);
185 struct passwd *getpwuid (uid_t uid);
186 struct passwd *getpwnam (const char *name);
188 uid_t geteuid (void);
190 gid_t getegid (void);
192 /* Stuff that gets set wrongly or otherwise */
193 #define HAVE_SETITIMER
194 #define HAVE_GETTIMEOFDAY
196 /* systime.h includes winsock.h which defines timeval */
198 #define HAVE_GETPAGESIZE
199 #define getpagesize() 4096
207 #undef GETTIMEOFDAY_ONE_ARGUMENT
208 #undef HAVE_SYS_WAIT_H
210 #undef SYSV_SYSTEM_DIR
211 #undef CLASH_DETECTION
213 /* We now have emulation for some signals */
215 #define sigset(s,h) mswindows_sigset(s,h)
216 #define sighold(s) mswindows_sighold(s)
217 #define sigrelse(s) mswindows_sigrelse(s)
218 #define sigpause(s) mswindows_sigpause(s)
219 #define signal sigset
221 /* Defines that we need that aren't in the standard signal.h */
222 #define SIGHUP 1 /* Hang up */
223 #define SIGQUIT 3 /* Quit process */
224 #define SIGKILL 9 /* Die, die die */
225 #define SIGALRM 14 /* Alarm */
226 #define SIGPROF 29 /* Profiling timer exp */
229 #define MAXPATHLEN _MAX_PATH
231 #endif /* !NOT_C_CODE */
233 /* Define for those source files that do not include enough NT
239 #define NULL ((void *)0)
243 /* Define process implementation */
244 #define HAVE_WIN32_PROCESSES
246 #define CORRECT_DIR_SEPS(s) \
247 do { if ('/' == DIRECTORY_SEP) dostounix_filename (s); \
248 else unixtodos_filename (s); \