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 GNU Emacs; 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. */
22 * Define symbols to identify the version of Unix this is.
23 * Define all the symbols that apply correctly.
34 /* #define BSD_SYSTEM */
40 #define DOS_NT /* MSDOS or WINDOWSNT */
43 /* If you are compiling with a non-C calling convention but need to
44 declare vararg routines differently, put it here */
45 #define _VARARGS_ __cdecl
47 /* If you are providing a function to something that will call the
48 function back (like a signal handler and signal, or main) its calling
49 convention must be whatever standard the libraries expect */
50 #define _CALLBACK_ __cdecl
52 /* SYSTEM_TYPE should indicate the kind of system you are using.
53 It sets the Lisp variable system-type. */
55 #define SYSTEM_TYPE "windows-nt"
56 #define SYMS_SYSTEM syms_of_ntterm ()
60 /* NOMULTIPLEJOBS should be defined if your system's shell
61 does not have "job control" (the ability to stop a program,
62 run some other program, then continue the first one). */
64 /* #define NOMULTIPLEJOBS 1 */
66 /* Emacs can read input using SIGIO and buffering characters itself,
67 or using CBREAK mode and making C-g cause SIGINT.
68 The choice is controlled by the variable interrupt_input.
70 Define INTERRUPT_INPUT to make interrupt_input = 1 the default (use SIGIO)
72 Emacs uses the presence or absence of the SIGIO macro to indicate
73 whether or not signal-driven I/O is possible. It uses
74 INTERRUPT_INPUT to decide whether to use it by default.
76 SIGIO can be used only on systems that implement it (4.2 and 4.3).
77 CBREAK mode has two disadvantages
78 1) At least in 4.2, it is impossible to handle the Meta key properly.
79 I hear that in system V this problem does not exist.
80 2) Control-G causes output to be discarded.
81 I do not know whether this can be fixed in system V.
83 Another method of doing input is planned but not implemented.
84 It would have Emacs fork off a separate process
85 to read the input and send it to the true Emacs process
88 /* #define INTERRUPT_INPUT 1 */
90 /* Letter to use in finding device name of first pty,
91 if system supports pty's. 'a' means it is /dev/ptya0 */
93 #define FIRST_PTY_LETTER 'a'
96 * Define HAVE_TERMIOS if the system provides POSIX-style
97 * functions and macros for terminal control.
99 * Define HAVE_TERMIO if the system provides sysV-style ioctls
100 * for terminal control.
102 * Do not define both. HAVE_TERMIOS is preferred, if it is
103 * supported on your system.
106 /* #define HAVE_TERMIOS 1 */
107 /* #define HAVE_TERMIO 1 */
110 * Define HAVE_TIMEVAL if the system supports the BSD style clock values.
111 * Look in <sys/time.h> for a timeval structure.
114 #define HAVE_TIMEVAL 1
117 * Define HAVE_SELECT if the system supports the `select' system call.
120 /* #define HAVE_SELECT 1 */
123 * Define HAVE_PTYS if the system supports pty devices.
126 /* #define HAVE_PTYS 1 */
129 * Define NONSYSTEM_DIR_LIBRARY to make Emacs emulate
130 * The 4.2 opendir, etc., library functions.
133 /* #define NONSYSTEM_DIR_LIBRARY */
135 /* NT supports Winsock which is close enough (with some hacks) */
137 #define HAVE_SOCKETS 1
139 /* Define this symbol if your system has the functions bcopy, etc. */
142 #define bzero(b, l) memset(b, 0, l)
143 #define bcopy(s, d, l) memmove(d, s, l)
144 #define bcmp(a, b, l) memcmp(a, b, l)
146 /* bcopy (aka memmove aka memcpy at least on x86) under MSVC is quite safe */
147 #define GAP_USE_BCOPY 1
148 #define BCOPY_UPWARD_SAFE 1
149 #define BCOPY_DOWNWARD_SAFE 1
151 /* subprocesses should be defined if you want to
152 have code for asynchronous subprocesses
153 (as used in M-x compile and M-x shell).
154 This is generally OS dependent, and not supported
155 under most USG systems. */
157 #define subprocesses 1
159 /* If your system uses COFF (Common Object File Format) then define the
160 preprocessor symbol "COFF". */
164 /* define MAIL_USE_FLOCK if the mailer uses flock
165 to interlock access to /usr/spool/mail/$USER.
166 The alternative is that a lock file named
167 /usr/spool/mail/$USER.lock. */
169 /* #define MAIL_USE_FLOCK */
170 #define MAIL_USE_POP 1
171 #define MAIL_USE_SYSTEM_LOCK 1
173 /* Define CLASH_DETECTION if you want lock files to be written
174 so that Emacs can tell instantly when you try to modify
175 a file that someone else has modified in his Emacs. */
177 /* #define CLASH_DETECTION 1 */
179 /* Define this if your operating system declares signal handlers to
180 have a type other than the usual. `The usual' is `void' for ANSI C
181 systems (i.e. when the __STDC__ macro is defined), and `int' for
182 pre-ANSI systems. If you're using GCC on an older system, __STDC__
183 will be defined, but the system's include files will still say that
184 signal returns int or whatever; in situations like that, define
185 this to be what the system's include files want. */
186 /* #define SIGTYPE int */
188 /* If the character used to separate elements of the executable path
189 is not ':', #define this to be the appropriate character constant. */
192 #define ORDINARY_LINK 1
194 /* ============================================================ */
196 /* Here, add any special hacks needed
197 to make Emacs work on this system. For example,
198 you might define certain system call names that don't
199 exist on your system, or that do different things on
200 your system and must be used only through an encapsulation
201 (Which you should place, by convention, in sysdep.c). */
203 /* Define this to be the separator between path elements */
204 #define DIRECTORY_SEP XINT (Vdirectory_sep_char)
206 /* Define this to be the separator between devices and paths */
207 #define DEVICE_SEP ':'
209 /* We'll support either convention on NT. */
210 #define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\')
211 #define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_))
213 /* The null device on Windows NT. */
214 #define NULL_DEVICE "NUL:"
217 #define MAXPATHLEN _MAX_PATH
220 #define LISP_FLOAT_TYPE 1
222 #undef HAVE_SYS_SELECT_H
223 #define HAVE_SYS_TIMEB_H 1
224 #define HAVE_SYS_TIME_H 1
225 #define HAVE_UNISTD_H 1
227 #undef HAVE_LINUX_VERSION_H
228 #undef HAVE_SYS_SYSTEMINFO_H
229 #undef HAVE_TERMIOS_H
230 #define HAVE_LIMITS_H 1
231 #define HAVE_STRING_H 1
232 #define STDC_HEADERS 1
233 #define TIME_WITH_SYS_TIME 1
235 #define HAVE_GETTIMEOFDAY 1
236 #define HAVE_GETHOSTNAME 1
237 #undef HAVE_GETDOMAINNAME
239 #define HAVE_RENAME 1
240 #define HAVE_CLOSEDIR 1
241 #define HAVE_FSYNC 1 /* fsync is called _commit in MSVC. */
243 #undef TM_IN_SYS_TIME
245 #define HAVE_TZNAME 1
247 #define HAVE_LONG_FILE_NAMES 1
251 #define HAVE_RANDOM 1
262 #undef HAVE_RES_INIT /* For -lresolv on Suns. */
264 #undef HAVE_FPATHCONF
266 #define HAVE_MKTIME 1
267 #undef HAVE_EUIDACCESS
268 #define HAVE_GETPAGESIZE 1
270 #define HAVE_SETLOCALE 1
272 #undef HAVE_SETRLIMIT
275 #define HAVE_SHUTDOWN 1
276 #define HAVE_STRFTIME 1
278 #define LOCALTIME_CACHE
279 #undef HAVE_INET_SOCKETS
281 #undef HAVE_AIX_SMT_EXP
283 /* Define if you have the ANSI `strerror' function.
284 Otherwise you must have the variable `char *sys_errlist[]'. */
285 #define HAVE_STRERROR 1
287 /* Define if `struct utimbuf' is declared by <utime.h>. */
288 #undef HAVE_STRUCT_UTIMBUF
291 #define HAVE_H_ERRNO 1
294 #define HAVE_WINDOW_SYSTEM 1
299 #define MODE_LINE_BINARY_TEXT(_b_) (NILP ((_b_)->buffer_file_type) ? "T" : "B")
301 /* get some redefinitions in place */
305 /* calls that are emulated or shadowed */
307 #define access sys_access
309 #define chdir sys_chdir
311 #define chmod sys_chmod
313 #define close sys_close
315 #define creat sys_creat
316 #define ctime sys_ctime
320 #define dup2 sys_dup2
321 #define fopen sys_fopen
322 #define link sys_link
323 #define mkdir sys_mkdir
325 #define mktemp sys_mktemp
327 #define open sys_open
328 #define pipe sys_pipe
330 #define read sys_read
331 #define rename sys_rename
332 #define rmdir sys_rmdir
333 #define select sys_select
334 #define sleep sys_sleep
335 #define strerror sys_strerror
337 #define unlink sys_unlink
339 #define write sys_write
341 /* subprocess calls that are emulated */
342 #define spawnve sys_spawnve
343 #define wait sys_wait
344 #define kill sys_kill
345 #define signal sys_signal
349 /* map to MSVC names */
350 #define execlp _execlp
351 #define execvp _execvp
352 #define fcloseall _fcloseall
353 #define fdopen _fdopen
354 #define fgetchar _fgetchar
355 #define fileno _fileno
356 #define flushall _flushall
357 #define fputchar _fputchar
358 #define fsync _commit
359 #define ftruncate _chsize
361 #define getpid _getpid
362 #define isatty _isatty
364 #define _longjmp longjmp
367 #define pclose _pclose
371 #define utimbuf _utimbuf
373 #define rindex strrchr
374 #define strdup _strdup
375 #define strupr _strupr
376 #define strnicmp _strnicmp
377 #define stricmp _stricmp
379 #define tzname _tzname
382 #define abort w32_abort
385 /* this is hacky, but is necessary to avoid warnings about macro
386 redefinitions using the SDK compilers */
389 #define MUST_UNDEF__STDC__
394 #ifdef MUST_UNDEF__STDC__
396 #undef MUST_UNDEF__STDC__
399 /* Defines that we need that aren't in the standard signal.h */
400 #define SIGHUP 1 /* Hang up */
401 #define SIGQUIT 3 /* Quit process */
402 #define SIGTRAP 5 /* Trace trap */
403 #define SIGKILL 9 /* Die, die die */
404 #define SIGPIPE 13 /* Write on pipe with no readers */
405 #define SIGALRM 14 /* Alarm */
406 #define SIGCHLD 18 /* Death of child */
412 /* For integration with MSDOS support. */
413 #define getdisk() (_getdrive () - 1)
415 #define getdefdir(_drv, _buf) ((_buf[0] = (_drv + 'A' - 1), _buf[1] = ':', _buf[2] = '/', _buf[3] = 0), 1)
417 #define getdefdir(_drv, _buf) _getdcwd (_drv, _buf, MAXPATHLEN)
420 extern char *get_emacs_configuration (void);
421 extern char *get_emacs_configuration_options (void);
422 #define EMACS_CONFIGURATION get_emacs_configuration ()
423 #define EMACS_CONFIG_OPTIONS get_emacs_configuration_options ()
425 /* Define this so that winsock.h definitions don't get included with
426 windows.h. For this to have proper effect, config.h must always be
427 included before windows.h. */
428 #define _WINSOCKAPI_ 1
431 /* Defines size_t and alloca (). */
433 #define malloc e_malloc
435 #define realloc e_realloc
436 #define calloc e_calloc
440 #include <sys/stat.h>
442 /* Define for those source files that do not include enough NT
448 #define NULL ((void *)0)
452 /* For proper declaration of environ. */
455 #define sys_nerr _sys_nerr
459 /* We need a little extra space, see ../../lisp/loadup.el */
460 #define SYSTEM_PURESIZE_EXTRA 137500
462 /* For unexec to work on Alpha systems, we need to put Emacs'
463 initialized data into a separate section from the CRT initialized
464 data (because the Alpha linker freely reorders data variables, even
465 across libraries, so our data and the CRT data get intermingled).
467 Starting with MSVC 5.0, we must also place the uninitialized data
468 into its own section. VC5 intermingles uninitialized data from the CRT
469 between Emacs' static uninitialized data and its public uninitialized
470 data. A separate .bss section for Emacs groups both static and
471 public uninitalized together.
473 Note that unexnt.c relies on this fact, and must be modified
474 accordingly if this section name is changed, or if this pragma is
475 removed. Also, obviously, all files that define initialized data
476 must include config.h to pick up this pragma. */
478 /* Names must be < 8 bytes */
479 #pragma data_seg("EMDATA")
480 #pragma bss_seg("EMBSS")
482 /* #define FULL_DEBUG */
483 /* #define EMACSDEBUG */
486 extern void _DebPrint (const char *fmt
, ...);
487 #define DebPrint(stuff) _DebPrint stuff
489 #define DebPrint(stuff)
493 /* ============================================================ */