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 <mingw32/process.h>
137 #define mkdir __mkdir
140 #ifdef HAVE_CYGWIN_VERSION_H
141 #include <cygwin/version.h>
144 /* IO calls that are emulated or shadowed */
145 #define pipe sys_pipe
146 int sys_pipe (int * phandles);
148 #ifndef HAVE_X_WINDOWS
149 #define sleep sys_sleep
150 void sleep (int seconds);
153 /* subprocess calls that are emulated */
154 #define spawnve sys_spawnve
155 int spawnve (int mode, const char *cmdname,
156 const char * const *argv, const char *const *envp);
158 #define wait sys_wait
159 int wait (int *status);
161 #define kill sys_kill
162 int kill (int pid, int sig);
164 /* map to MSVC names */
166 #define pclose _pclose
168 /* Encapsulation of system calls */
169 #ifndef DONT_ENCAPSULATE
170 #define getpid sys_getpid
174 #define DONT_USE_LITOUT
176 /* Random global functions called everywhere. Implemented in nt.c */
177 /* #### Most of these are FSFisms and must be avoided */
178 /* #### All of these are FSFisms and must be avoided */
179 void dostounix_filename (char *p);
180 void unixtodos_filename (char *p);
181 int crlf_to_lf (int n, unsigned char *buf, unsigned int *lf_count);
183 char *getwd (char *dir);
185 void *sbrk (unsigned long increment);
188 struct passwd *getpwuid (uid_t uid);
189 struct passwd *getpwnam (const char *name);
191 uid_t geteuid (void);
193 gid_t getegid (void);
195 #if CYGWIN_VERSION_DLL_MAJOR <= 21
200 /* Stuff that gets set wrongly or otherwise */
201 #define HAVE_SETITIMER
202 #define HAVE_GETTIMEOFDAY
204 /* systime.h includes winsock.h which defines timeval */
206 #define HAVE_GETPAGESIZE
207 #define getpagesize() 4096
215 #undef GETTIMEOFDAY_ONE_ARGUMENT
216 #undef HAVE_SYS_WAIT_H
218 #undef SYSV_SYSTEM_DIR
219 #undef CLASH_DETECTION
221 /* We now have emulation for some signals */
223 #define sigset(s,h) mswindows_sigset(s,h)
224 #define sighold(s) mswindows_sighold(s)
225 #define sigrelse(s) mswindows_sigrelse(s)
226 #define sigpause(s) mswindows_sigpause(s)
227 #define signal sigset
229 /* Defines that we need that aren't in the standard signal.h */
230 #define SIGHUP 1 /* Hang up */
231 #define SIGQUIT 3 /* Quit process */
232 #define SIGKILL 9 /* Die, die die */
233 #define SIGALRM 14 /* Alarm */
234 #define SIGPROF 29 /* Profiling timer exp */
237 #define MAXPATHLEN _MAX_PATH
239 #endif /* !NOT_C_CODE */
241 /* Define for those source files that do not include enough NT
247 #define NULL ((void *)0)
251 /* Define process implementation */
252 #define HAVE_WIN32_PROCESSES
254 #define CORRECT_DIR_SEPS(s) \
255 do { if ('/' == DIRECTORY_SEP) dostounix_filename (s); \
256 else unixtodos_filename (s); \