1 /* System description file for Windows NT.
2 Copyright (C) 1993, 1994, 1995 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 /* Synched up with: FSF 19.31. */
28 #define DOS_NT /* MSDOS or WINDOWSNT */
31 /* In case non-Microsoft compiler is used, we fake _MSC_VER */
36 typedef unsigned short mode_t;
37 /* typedef long ptrdiff_t; -kkm */
42 /* If you are compiling with a non-C calling convention but need to
43 declare vararg routines differently, put it here */
44 #define _VARARGS_ __cdecl
46 /* If you are providing a function to something that will call the
47 function back (like a signal handler and signal, or main) its calling
48 convention must be whatever standard the libraries expect */
49 #define _CALLBACK_ __cdecl
51 /* SYSTEM_TYPE should indicate the kind of system you are using.
52 It sets the Lisp variable system-type. */
54 #define SYSTEM_TYPE "windows-nt"
58 #define SIZEOF_SHORT 2
61 #define SIZEOF_LONG_LONG 8
62 #define SIZEOF_VOID_P 4
64 /* NOMULTIPLEJOBS should be defined if your system's shell
65 does not have "job control" (the ability to stop a program,
66 run some other program, then continue the first one). */
68 /* #define NOMULTIPLEJOBS */
70 /* Letter to use in finding device name of first pty,
71 if system supports pty's. 'a' means it is /dev/ptya0 */
73 #define FIRST_PTY_LETTER 'a'
76 * Define HAVE_TIMEVAL if the system supports the BSD style clock values.
77 * Look in <sys/time.h> for a timeval structure.
83 * Define HAVE_SELECT if the system supports the `select' system call.
86 /* #define HAVE_SELECT */
89 * Define HAVE_PTYS if the system supports pty devices.
92 /* #define HAVE_PTYS */
94 /* If your system uses COFF (Common Object File Format) then define the
95 preprocessor symbol "COFF". */
99 /* NT supports Winsock which is close enough (with some hacks) */
103 /* define MAIL_USE_FLOCK if the mailer uses flock
104 to interlock access to /usr/spool/mail/$USER.
105 The alternative is that a lock file named
106 /usr/spool/mail/$USER.lock. */
108 /* #define MAIL_USE_FLOCK */
110 #define MAIL_USE_SYSTEM_LOCK
112 /* If the character used to separate elements of the executable path
113 is not ':', #define this to be the appropriate character constant. */
116 /* ============================================================ */
118 /* Here, add any special hacks needed
119 to make Emacs work on this system. For example,
120 you might define certain system call names that don't
121 exist on your system, or that do different things on
122 your system and must be used only through an encapsulation
123 (Which you should place, by convention, in sysdep.c). */
125 /* XEmacs file I/O for DOS text files requires FILE_CODING */
128 #define DIRECTORY_SEP '\\'
130 /* Define this to be the separator between devices and paths */
131 #define DEVICE_SEP ':'
133 /* We'll support either convention on NT. */
134 #define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\')
135 #define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_))
137 /* The null device on Windows NT. */
138 #define NULL_DEVICE "NUL:"
139 #define EXEC_SUFFIXES ".exe:.com:.bat:.cmd:"
142 #define MAXPATHLEN _MAX_PATH
145 #define LISP_FLOAT_TYPE
147 #define HAVE_GETTIMEOFDAY
148 #define HAVE_GETHOSTNAME
151 #define HAVE_CLOSEDIR
155 #define HAVE_LONG_FILE_NAMES
168 #define HAVE_STRUCT_UTIMBUF
171 #define HAVE_WINDOW_SYSTEM
175 #define HAVE_STRCASECMP
177 /* Compatibility macros. Some used to be routines in nt.c */
178 #define strcasecmp(x,y) _stricmp(x,y)
179 #define random() (rand() << 15 | rand())
180 #define srandom(seed) (srand(seed))
181 #define setpgrp(pid,gid)
183 #define MODE_LINE_BINARY_TEXT(_b_) (NILP ((_b_)->buffer_file_type) ? "T" : "B")
185 /* get some redefinitions in place */
188 /* IO calls that are emulated or shadowed */
189 #define access sys_access
190 #define chdir sys_chdir
191 #define chmod sys_chmod
192 #define close sys_close
193 #define creat sys_creat
194 #define ctime sys_ctime
196 #define dup2 sys_dup2
197 #define fopen sys_fopen
198 #define link sys_link
199 #define mktemp sys_mktemp
200 #define open sys_open
201 #define read sys_read
202 #define rename sys_rename
203 #define unlink sys_unlink
204 #define write sys_write
205 #define mkdir sys_mkdir
206 #define rmdir sys_rmdir
211 /* this is hacky, but is necessary to avoid warnings about macro
212 redefinitions using the SDK compilers */
215 #define MUST_UNDEF__STDC__
220 #ifdef MUST_UNDEF__STDC__
222 #undef MUST_UNDEF__STDC__
229 /* IO calls that are emulated or shadowed */
230 #define pipe sys_pipe
231 int sys_pipe (int * phandles);
233 #ifndef HAVE_X_WINDOWS
234 #define sleep sys_sleep
235 void sleep (int seconds);
238 /* subprocess calls that are emulated */
239 #define spawnve sys_spawnve
240 int spawnve (int mode, CONST char *cmdname,
241 CONST char * CONST *argv, CONST char *CONST *envp);
243 #define wait sys_wait
244 int wait (int *status);
246 #define kill sys_kill
247 int kill (int pid, int sig);
249 /* map to MSVC names */
251 #define pclose _pclose
255 #define execlp _execlp
256 #define execvp _execvp
257 #define fcloseall _fcloseall
258 #define fdopen _fdopen
259 #define fgetchar _fgetchar
260 #define fileno _fileno
261 #define flushall _flushall
262 #define fputchar _fputchar
264 #define getpid _getpid
265 #define isatty _isatty
267 #define _longjmp longjmp
271 /* #define utime _utime */
273 #define rindex strrchr
276 #define getcwd _getcwd
279 #define abort win32_abort
284 /* Encapsulation of system calls */
285 #ifndef DONT_ENCAPSULATE
286 #define getpid sys_getpid
290 /* Random global functions called everywhere. Implemented in nt.c */
291 /* #### Most of these are FSFisms and must be avoided */
292 /* #### All of these are FSFisms and must be avoided */
293 void dostounix_filename (char *p);
294 void unixtodos_filename (char *p);
295 int crlf_to_lf (int n, unsigned char *buf, unsigned int *lf_count);
297 char *getwd (char *dir);
299 void *sbrk (unsigned long increment);
302 struct passwd *getpwuid (int uid);
303 struct passwd *getpwnam (const char *name);
309 /* Setitimer is emulated */
310 #define HAVE_SETITIMER
312 /* We now have emulation for some signals */
314 #define sigset(s,h) msw_sigset(s,h)
315 #define sighold(s) msw_sighold(s)
316 #define sigrelse(s) msw_sigrelse(s)
317 #define sigpause(s) msw_sigpause(s)
318 #define signal sigset
320 /* Defines that we need that aren't in the standard signal.h */
321 #define SIGHUP 1 /* Hang up */
322 #define SIGQUIT 3 /* Quit process */
323 #define SIGKILL 9 /* Die, die die */
324 #define SIGALRM 14 /* Alarm */
325 #define SIGPROF 29 /* Profiling timer exp */
327 /* For integration with MSDOS support. */
328 #define getdisk() (_getdrive () - 1)
329 #define getdefdir(_drv, _buf) _getdcwd (_drv, _buf, MAXPATHLEN)
331 #if 0 /* they do. -kkm */
332 /* Define this so that winsock.h definitions don't get included when windows.h
333 is... I don't know if they do the right thing for emacs. For this to
334 have proper effect, config.h must always be included before windows.h. */
335 #define _WINSOCKAPI_ 1
338 /* Defines size_t and alloca (). */
341 #include <sys/stat.h>
343 /* Define for those source files that do not include enough NT
349 #define NULL ((void *)0)
353 /* For proper declaration of environ. */
357 /* Define process implementation */
358 #define HAVE_WIN32_PROCESSES
360 /* We need a little extra space, see ../../lisp/loadup.el */
361 #define SYSTEM_PURESIZE_EXTRA 15000
363 /* ============================================================ */
366 #if (_MSC_VER >= 1100)
367 #define DUMP_SEPARATE_SECTION
369 #ifdef DUMP_SEPARATE_SECTION
370 #pragma data_seg("xdata")
371 #pragma bss_seg("xdata")