* config.nt (HAVE_FACES): Remove, unused.
[bpt/emacs.git] / src / s / ms-w32.h
1 /* System description file for Windows NT.
2 Copyright (C) 1993, 1994, 1995, 2001, 2002, 2003, 2004, 2005, 2006,
3 2007, 2008 Free Software Foundation, Inc.
4
5 This file is part of GNU Emacs.
6
7 GNU Emacs is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 GNU Emacs is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19
20 /*
21 * Define symbols to identify the version of Unix this is.
22 * Define all the symbols that apply correctly.
23 */
24
25 #ifndef WINDOWSNT
26 #define WINDOWSNT
27 #endif
28 #ifndef DOS_NT
29 #define DOS_NT /* MSDOS or WINDOWSNT */
30 #endif
31
32 /* If you are compiling with a non-C calling convention but need to
33 declare vararg routines differently, put it here */
34 #define _VARARGS_ __cdecl
35
36 /* If you are providing a function to something that will call the
37 function back (like a signal handler and signal, or main) its calling
38 convention must be whatever standard the libraries expect */
39 #define _CALLBACK_ __cdecl
40
41 /* SYSTEM_TYPE should indicate the kind of system you are using.
42 It sets the Lisp variable system-type. */
43
44 #define SYSTEM_TYPE "windows-nt"
45 #define SYMS_SYSTEM syms_of_ntterm ()
46
47 #define NO_MATHERR 1
48
49 /* NOMULTIPLEJOBS should be defined if your system's shell
50 does not have "job control" (the ability to stop a program,
51 run some other program, then continue the first one). */
52
53 /* #define NOMULTIPLEJOBS 1 */
54
55 /* Emacs can read input using SIGIO and buffering characters itself,
56 or using CBREAK mode and making C-g cause SIGINT.
57 The choice is controlled by the variable interrupt_input.
58
59 Define INTERRUPT_INPUT to make interrupt_input = 1 the default (use SIGIO)
60
61 Emacs uses the presence or absence of the SIGIO macro to indicate
62 whether or not signal-driven I/O is possible. It uses
63 INTERRUPT_INPUT to decide whether to use it by default.
64
65 SIGIO can be used only on systems that implement it (4.2 and 4.3).
66 CBREAK mode has two disadvantages
67 1) At least in 4.2, it is impossible to handle the Meta key properly.
68 I hear that in system V this problem does not exist.
69 2) Control-G causes output to be discarded.
70 I do not know whether this can be fixed in system V.
71
72 Another method of doing input is planned but not implemented.
73 It would have Emacs fork off a separate process
74 to read the input and send it to the true Emacs process
75 through a pipe. */
76
77 /* #define INTERRUPT_INPUT 1 */
78
79 /* Letter to use in finding device name of first pty,
80 if system supports pty's. 'a' means it is /dev/ptya0 */
81
82 #define FIRST_PTY_LETTER 'a'
83
84 /*
85 * Define HAVE_TERMIOS if the system provides POSIX-style
86 * functions and macros for terminal control.
87 *
88 * Define HAVE_TERMIO if the system provides sysV-style ioctls
89 * for terminal control.
90 *
91 * Do not define both. HAVE_TERMIOS is preferred, if it is
92 * supported on your system.
93 */
94
95 /* #define HAVE_TERMIOS 1 */
96 /* #define HAVE_TERMIO 1 */
97
98 /*
99 * Define HAVE_TIMEVAL if the system supports the BSD style clock values.
100 * Look in <sys/time.h> for a timeval structure.
101 */
102
103 #define HAVE_TIMEVAL 1
104
105 /*
106 * Define HAVE_SELECT if the system supports the `select' system call.
107 */
108
109 /* #define HAVE_SELECT 1 */
110
111 /*
112 * Define HAVE_PTYS if the system supports pty devices.
113 */
114
115 /* #define HAVE_PTYS 1 */
116
117 /*
118 * Define NONSYSTEM_DIR_LIBRARY to make Emacs emulate
119 * The 4.2 opendir, etc., library functions.
120 */
121
122 /* #define NONSYSTEM_DIR_LIBRARY */
123
124 /* NT supports Winsock which is close enough (with some hacks) */
125
126 #define HAVE_SOCKETS 1
127
128 /* But our select implementation doesn't allow us to make non-blocking
129 connects. So until that is fixed, this is necessary: */
130
131 #define BROKEN_NON_BLOCKING_CONNECT 1
132
133 /* And the select implementation does 1-byte read-ahead waiting
134 for received packets, so datagrams are broken too. */
135
136 #define BROKEN_DATAGRAM_SOCKETS 1
137
138 /* Define this symbol if your system has the functions bcopy, etc. */
139
140 #define BSTRING
141 #define bzero(b, l) memset(b, 0, l)
142 #define bcopy(s, d, l) memmove(d, s, l)
143 #define bcmp(a, b, l) memcmp(a, b, l)
144
145 /* bcopy (aka memmove aka memcpy at least on x86) under MSVC is quite safe */
146 #define GAP_USE_BCOPY 1
147 #define BCOPY_UPWARD_SAFE 1
148 #define BCOPY_DOWNWARD_SAFE 1
149
150 /* subprocesses should be defined if you want to
151 have code for asynchronous subprocesses
152 (as used in M-x compile and M-x shell).
153 This is generally OS dependent, and not supported
154 under most USG systems. */
155
156 #define subprocesses 1
157
158 /* If your system uses COFF (Common Object File Format) then define the
159 preprocessor symbol "COFF". */
160
161 #define COFF 1
162
163 /* define MAIL_USE_FLOCK if the mailer uses flock
164 to interlock access to /usr/spool/mail/$USER.
165 The alternative is that a lock file named
166 /usr/spool/mail/$USER.lock. */
167
168 /* #define MAIL_USE_FLOCK */
169 #define MAIL_USE_POP 1
170 #define MAIL_USE_SYSTEM_LOCK 1
171
172 /* Define CLASH_DETECTION if you want lock files to be written
173 so that Emacs can tell instantly when you try to modify
174 a file that someone else has modified in his Emacs. */
175
176 /* #define CLASH_DETECTION 1 */
177
178 /* Define this if your operating system declares signal handlers to
179 have a type other than the usual. `The usual' is `void' for ANSI C
180 systems (i.e. when the __STDC__ macro is defined), and `int' for
181 pre-ANSI systems. If you're using GCC on an older system, __STDC__
182 will be defined, but the system's include files will still say that
183 signal returns int or whatever; in situations like that, define
184 this to be what the system's include files want. */
185 /* #define SIGTYPE int */
186
187 /* If the character used to separate elements of the executable path
188 is not ':', #define this to be the appropriate character constant. */
189 #define SEPCHAR ';'
190
191 #define ORDINARY_LINK 1
192
193 /* ============================================================ */
194
195 /* Here, add any special hacks needed
196 to make Emacs work on this system. For example,
197 you might define certain system call names that don't
198 exist on your system, or that do different things on
199 your system and must be used only through an encapsulation
200 (Which you should place, by convention, in sysdep.c). */
201
202 /* Define this to be the separator between path elements */
203 #define DIRECTORY_SEP XINT (Vdirectory_sep_char)
204
205 /* Define this to be the separator between devices and paths */
206 #define DEVICE_SEP ':'
207
208 /* We'll support either convention on NT. */
209 #define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\')
210 #define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_))
211
212 /* The null device on Windows NT. */
213 #define NULL_DEVICE "NUL:"
214
215 #ifndef MAXPATHLEN
216 #define MAXPATHLEN _MAX_PATH
217 #endif
218
219 #define HAVE_SOUND 1
220 #define LISP_FLOAT_TYPE 1
221
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
226 #undef HAVE_UTIME_H
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 HAVE_STDLIB_H 1
233 #define HAVE_PWD_H 1
234 #define STDC_HEADERS 1
235 #define TIME_WITH_SYS_TIME 1
236
237 #define HAVE_GETTIMEOFDAY 1
238 #define HAVE_GETHOSTNAME 1
239 #undef HAVE_GETDOMAINNAME
240 #define HAVE_DUP2 1
241 #define HAVE_RENAME 1
242 #define HAVE_CLOSEDIR 1
243 #define HAVE_FSYNC 1 /* fsync is called _commit in MSVC. */
244
245 #undef TM_IN_SYS_TIME
246 #undef HAVE_TM_ZONE
247
248 #define HAVE_LONG_FILE_NAMES 1
249
250 #define HAVE_MKDIR 1
251 #define HAVE_RMDIR 1
252 #define HAVE_RANDOM 1
253 #undef HAVE_SYSINFO
254 #undef HAVE_LRAND48
255 #define HAVE_BCOPY 1
256 #define HAVE_BCMP 1
257 #define HAVE_LOGB 1
258 #define HAVE_FREXP 1
259 #define HAVE_FMOD 1
260 #undef HAVE_RINT
261 #undef HAVE_CBRT
262 #define HAVE_FTIME 1
263 #undef HAVE_RES_INIT /* For -lresolv on Suns. */
264 #undef HAVE_SETSID
265 #undef HAVE_FPATHCONF
266 #define HAVE_SELECT 1
267 #define HAVE_MKTIME 1
268 #undef HAVE_EUIDACCESS
269 #define HAVE_GETPAGESIZE 1
270 #define HAVE_TZSET 1
271 #define HAVE_SETLOCALE 1
272 #undef HAVE_UTIMES
273 #undef HAVE_SETRLIMIT
274 #undef HAVE_SETPGID
275 #undef HAVE_GETCWD
276 #define HAVE_SHUTDOWN 1
277 #define HAVE_STRFTIME 1
278
279 #define LOCALTIME_CACHE
280 #define HAVE_INET_SOCKETS 1
281
282 #undef HAVE_AIX_SMT_EXP
283 #define USE_TOOLKIT_SCROLL_BARS 1
284
285 /* Define if you have the ANSI `strerror' function.
286 Otherwise you must have the variable `char *sys_errlist[]'. */
287 #define HAVE_STRERROR 1
288
289 /* Define if `struct utimbuf' is declared by <utime.h>. */
290 #undef HAVE_STRUCT_UTIMBUF
291
292 #define HAVE_MOUSE 1
293 #define HAVE_H_ERRNO 1
294
295 #define MULTI_KBOARD 1
296
297 #ifdef HAVE_NTGUI
298 #define HAVE_WINDOW_SYSTEM 1
299 #define HAVE_MENUS 1
300 #endif
301
302 #define MODE_LINE_BINARY_TEXT(_b_) (NILP ((_b_)->buffer_file_type) ? "T" : "B")
303
304 /* get some redefinitions in place */
305
306 #ifdef emacs
307
308 /* calls that are emulated or shadowed */
309 #undef access
310 #define access sys_access
311 #undef chdir
312 #define chdir sys_chdir
313 #undef chmod
314 #define chmod sys_chmod
315 #define chown sys_chown
316 #undef close
317 #define close sys_close
318 #undef creat
319 #define creat sys_creat
320 #define ctime sys_ctime
321 #undef dup
322 #define dup sys_dup
323 #undef dup2
324 #define dup2 sys_dup2
325 #define fopen sys_fopen
326 #define link sys_link
327 #define mkdir sys_mkdir
328 #undef mktemp
329 #define mktemp sys_mktemp
330 #undef open
331 #define open sys_open
332 #define pipe sys_pipe
333 #undef read
334 #define read sys_read
335 #define rename sys_rename
336 #define rmdir sys_rmdir
337 #define select sys_select
338 #define sleep sys_sleep
339 #define strerror sys_strerror
340 #undef unlink
341 #define unlink sys_unlink
342 #undef write
343 #define write sys_write
344
345 /* subprocess calls that are emulated */
346 #define spawnve sys_spawnve
347 #define wait sys_wait
348 #define kill sys_kill
349 #define signal sys_signal
350
351 #endif /* emacs */
352
353 /* map to MSVC names */
354 #define execlp _execlp
355 #define execvp _execvp
356 #define fcloseall _fcloseall
357 #define fdopen _fdopen
358 #define fgetchar _fgetchar
359 #ifndef fileno
360 #define fileno _fileno
361 #endif
362 #define flushall _flushall
363 #define fputchar _fputchar
364 #define fsync _commit
365 #define ftruncate _chsize
366 #define getw _getw
367 #define getpid _getpid
368 #ifdef _MSC_VER
369 typedef int pid_t;
370 #endif
371 #define isatty _isatty
372 #define logb _logb
373 #define _longjmp longjmp
374 #define lseek _lseek
375 #define popen _popen
376 #define pclose _pclose
377 #define putw _putw
378 #define umask _umask
379 #define utimbuf _utimbuf
380 #define index strchr
381 #define rindex strrchr
382 #define strdup _strdup
383 #define strupr _strupr
384 #define strnicmp _strnicmp
385 #define stricmp _stricmp
386 #define tzset _tzset
387
388 #if !defined (_MSC_VER) || (_MSC_VER < 1400)
389 #define tzname _tzname
390 #define utime _utime
391 #endif
392
393 /* this is hacky, but is necessary to avoid warnings about macro
394 redefinitions using the SDK compilers */
395 #ifndef __STDC__
396 #define __STDC__ 1
397 #define MUST_UNDEF__STDC__
398 #endif
399 #include <direct.h>
400 #include <io.h>
401 #include <stdio.h>
402 #ifdef MUST_UNDEF__STDC__
403 #undef __STDC__
404 #undef MUST_UNDEF__STDC__
405 #endif
406
407 /* Defines that we need that aren't in the standard signal.h */
408 #define SIGHUP 1 /* Hang up */
409 #define SIGQUIT 3 /* Quit process */
410 #define SIGTRAP 5 /* Trace trap */
411 #define SIGKILL 9 /* Die, die die */
412 #define SIGPIPE 13 /* Write on pipe with no readers */
413 #define SIGALRM 14 /* Alarm */
414 #define SIGCHLD 18 /* Death of child */
415
416 #ifndef NSIG
417 #define NSIG 23
418 #endif
419
420 /* For integration with MSDOS support. */
421 #define getdisk() (_getdrive () - 1)
422 #ifdef emacs
423 #define getdefdir(_drv, _buf) ((_buf[0] = (_drv + 'A' - 1), _buf[1] = ':', _buf[2] = '/', _buf[3] = 0), 1)
424 #else
425 #define getdefdir(_drv, _buf) _getdcwd (_drv, _buf, MAXPATHLEN)
426 #endif
427
428 extern char *get_emacs_configuration (void);
429 extern char *get_emacs_configuration_options (void);
430 #define EMACS_CONFIGURATION get_emacs_configuration ()
431 #define EMACS_CONFIG_OPTIONS get_emacs_configuration_options ()
432
433 /* Define this so that winsock.h definitions don't get included with
434 windows.h. For this to have proper effect, config.h must always be
435 included before windows.h. */
436 #define _WINSOCKAPI_ 1
437 #define _WINSOCK_H
438
439 /* Defines size_t and alloca (). */
440 #ifdef USE_CRT_DLL
441 #define malloc e_malloc
442 #define free e_free
443 #define realloc e_realloc
444 #define calloc e_calloc
445 #endif
446 #include <malloc.h>
447
448 #include <sys/stat.h>
449
450 /* Define for those source files that do not include enough NT
451 system files. */
452 #ifndef NULL
453 #ifdef __cplusplus
454 #define NULL 0
455 #else
456 #define NULL ((void *)0)
457 #endif
458 #endif
459
460 /* For proper declaration of environ. */
461 #include <stdlib.h>
462 #ifndef sys_nerr
463 #define sys_nerr _sys_nerr
464 #endif
465 #include <string.h>
466
467 /* We need a little extra space, see ../../lisp/loadup.el. */
468 #define SYSTEM_PURESIZE_EXTRA 50000
469
470 /* For unexec to work on Alpha systems, we need to put Emacs'
471 initialized data into a separate section from the CRT initialized
472 data (because the Alpha linker freely reorders data variables, even
473 across libraries, so our data and the CRT data get intermingled).
474
475 Starting with MSVC 5.0, we must also place the uninitialized data
476 into its own section. VC5 intermingles uninitialized data from the CRT
477 between Emacs' static uninitialized data and its public uninitialized
478 data. A separate .bss section for Emacs groups both static and
479 public uninitialized together.
480
481 Note that unexw32.c relies on this fact, and must be modified
482 accordingly if this section name is changed, or if this pragma is
483 removed. Also, obviously, all files that define initialized data
484 must include config.h to pick up this pragma. */
485
486 /* Names must be < 8 bytes */
487 #ifdef _MSC_VER
488 #pragma data_seg("EMDATA")
489 #pragma bss_seg("EMBSS")
490 #endif
491
492 /* #define FULL_DEBUG */
493 /* #define EMACSDEBUG */
494
495 #ifdef EMACSDEBUG
496 extern void _DebPrint (const char *fmt, ...);
497 #define DebPrint(stuff) _DebPrint stuff
498 #else
499 #define DebPrint(stuff)
500 #endif
501
502
503 /* ============================================================ */
504
505 /* arch-tag: 5d4a3a1c-40dc-4dea-9c7c-38fed9ae0eae
506 (do not change this comment) */