* systty.h: Remove code for Aix on 386, unsupported platform.
[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 /* Letter to use in finding device name of first pty,
50 if system supports pty's. 'a' means it is /dev/ptya0 */
51
52 #define FIRST_PTY_LETTER 'a'
53
54 /*
55 * Define HAVE_TIMEVAL if the system supports the BSD style clock values.
56 * Look in <sys/time.h> for a timeval structure.
57 */
58
59 #define HAVE_TIMEVAL 1
60
61 /* NT supports Winsock which is close enough (with some hacks) */
62
63 #define HAVE_SOCKETS 1
64
65 /* But our select implementation doesn't allow us to make non-blocking
66 connects. So until that is fixed, this is necessary: */
67
68 #define BROKEN_NON_BLOCKING_CONNECT 1
69
70 /* And the select implementation does 1-byte read-ahead waiting
71 for received packets, so datagrams are broken too. */
72
73 #define BROKEN_DATAGRAM_SOCKETS 1
74
75 /* Define this symbol if your system has the functions bcopy, etc. */
76
77 #define BSTRING
78 #define bzero(b, l) memset(b, 0, l)
79 #define bcopy(s, d, l) memmove(d, s, l)
80 #define bcmp(a, b, l) memcmp(a, b, l)
81
82 /* bcopy (aka memmove aka memcpy at least on x86) under MSVC is quite safe */
83 #define GAP_USE_BCOPY 1
84 #define BCOPY_UPWARD_SAFE 1
85 #define BCOPY_DOWNWARD_SAFE 1
86
87 /* subprocesses should be defined if you want to
88 have code for asynchronous subprocesses
89 (as used in M-x compile and M-x shell).
90 This is generally OS dependent, and not supported
91 under most USG systems. */
92
93 #define subprocesses 1
94
95 /* If your system uses COFF (Common Object File Format) then define the
96 preprocessor symbol "COFF". */
97
98 #define COFF 1
99
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. */
104
105 /* #define MAIL_USE_FLOCK */
106 #define MAIL_USE_POP 1
107 #define MAIL_USE_SYSTEM_LOCK 1
108
109 /* If the character used to separate elements of the executable path
110 is not ':', #define this to be the appropriate character constant. */
111 #define SEPCHAR ';'
112
113 #define ORDINARY_LINK 1
114
115 /* ============================================================ */
116
117 /* Here, add any special hacks needed
118 to make Emacs work on this system. For example,
119 you might define certain system call names that don't
120 exist on your system, or that do different things on
121 your system and must be used only through an encapsulation
122 (Which you should place, by convention, in sysdep.c). */
123
124 /* Define this to be the separator between path elements */
125 #define DIRECTORY_SEP XINT (Vdirectory_sep_char)
126
127 /* Define this to be the separator between devices and paths */
128 #define DEVICE_SEP ':'
129
130 /* We'll support either convention on NT. */
131 #define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\')
132 #define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_))
133
134 /* The null device on Windows NT. */
135 #define NULL_DEVICE "NUL:"
136
137 #ifndef MAXPATHLEN
138 #define MAXPATHLEN _MAX_PATH
139 #endif
140
141 #define HAVE_SOUND 1
142 #define LISP_FLOAT_TYPE 1
143
144 #undef HAVE_SYS_SELECT_H
145 #define HAVE_SYS_TIMEB_H 1
146 #define HAVE_SYS_TIME_H 1
147 #define HAVE_UNISTD_H 1
148 #undef HAVE_UTIME_H
149 #undef HAVE_LINUX_VERSION_H
150 #undef HAVE_SYS_SYSTEMINFO_H
151 #undef HAVE_TERMIOS_H
152 #define HAVE_LIMITS_H 1
153 #define HAVE_STRING_H 1
154 #define HAVE_STDLIB_H 1
155 #define HAVE_PWD_H 1
156 #define STDC_HEADERS 1
157 #define TIME_WITH_SYS_TIME 1
158
159 #define HAVE_GETTIMEOFDAY 1
160 #define HAVE_GETHOSTNAME 1
161 #undef HAVE_GETDOMAINNAME
162 #define HAVE_DUP2 1
163 #define HAVE_RENAME 1
164 #define HAVE_CLOSEDIR 1
165 #define HAVE_FSYNC 1 /* fsync is called _commit in MSVC. */
166
167 #undef TM_IN_SYS_TIME
168 #undef HAVE_TM_ZONE
169
170 #define HAVE_LONG_FILE_NAMES 1
171
172 #define HAVE_MKDIR 1
173 #define HAVE_RMDIR 1
174 #define HAVE_RANDOM 1
175 #undef HAVE_SYSINFO
176 #undef HAVE_LRAND48
177 #define HAVE_BCOPY 1
178 #define HAVE_BCMP 1
179 #define HAVE_LOGB 1
180 #define HAVE_FREXP 1
181 #define HAVE_FMOD 1
182 #undef HAVE_RINT
183 #undef HAVE_CBRT
184 #define HAVE_FTIME 1
185 #undef HAVE_RES_INIT /* For -lresolv on Suns. */
186 #undef HAVE_SETSID
187 #undef HAVE_FPATHCONF
188 #define HAVE_SELECT 1
189 #define HAVE_MKTIME 1
190 #undef HAVE_EUIDACCESS
191 #define HAVE_GETPAGESIZE 1
192 #define HAVE_TZSET 1
193 #define HAVE_SETLOCALE 1
194 #undef HAVE_UTIMES
195 #undef HAVE_SETRLIMIT
196 #undef HAVE_SETPGID
197 #undef HAVE_GETCWD
198 #define HAVE_SHUTDOWN 1
199 #define HAVE_STRFTIME 1
200
201 #define LOCALTIME_CACHE
202 #define HAVE_INET_SOCKETS 1
203
204 #undef HAVE_AIX_SMT_EXP
205 #define USE_TOOLKIT_SCROLL_BARS 1
206
207 /* Define if you have the ANSI `strerror' function.
208 Otherwise you must have the variable `char *sys_errlist[]'. */
209 #define HAVE_STRERROR 1
210
211 /* Define if `struct utimbuf' is declared by <utime.h>. */
212 #undef HAVE_STRUCT_UTIMBUF
213
214 #define HAVE_MOUSE 1
215 #define HAVE_H_ERRNO 1
216
217 #define MULTI_KBOARD 1
218
219 #ifdef HAVE_NTGUI
220 #define HAVE_WINDOW_SYSTEM 1
221 #define HAVE_MENUS 1
222 #endif
223
224 #define MODE_LINE_BINARY_TEXT(_b_) (NILP ((_b_)->buffer_file_type) ? "T" : "B")
225
226 /* get some redefinitions in place */
227
228 #ifdef emacs
229
230 /* calls that are emulated or shadowed */
231 #undef access
232 #define access sys_access
233 #undef chdir
234 #define chdir sys_chdir
235 #undef chmod
236 #define chmod sys_chmod
237 #define chown sys_chown
238 #undef close
239 #define close sys_close
240 #undef creat
241 #define creat sys_creat
242 #define ctime sys_ctime
243 #undef dup
244 #define dup sys_dup
245 #undef dup2
246 #define dup2 sys_dup2
247 #define fopen sys_fopen
248 #define link sys_link
249 #define mkdir sys_mkdir
250 #undef mktemp
251 #define mktemp sys_mktemp
252 #undef open
253 #define open sys_open
254 #define pipe sys_pipe
255 #undef read
256 #define read sys_read
257 #define rename sys_rename
258 #define rmdir sys_rmdir
259 #define select sys_select
260 #define sleep sys_sleep
261 #define strerror sys_strerror
262 #undef unlink
263 #define unlink sys_unlink
264 #undef write
265 #define write sys_write
266
267 /* subprocess calls that are emulated */
268 #define spawnve sys_spawnve
269 #define wait sys_wait
270 #define kill sys_kill
271 #define signal sys_signal
272
273 #endif /* emacs */
274
275 /* map to MSVC names */
276 #define execlp _execlp
277 #define execvp _execvp
278 #define fdopen _fdopen
279 #ifndef fileno
280 #define fileno _fileno
281 #endif
282 #define fsync _commit
283 #define ftruncate _chsize
284 #define getpid _getpid
285 #ifdef _MSC_VER
286 typedef int pid_t;
287 #endif
288 #define isatty _isatty
289 #define logb _logb
290 #define _longjmp longjmp
291 #define lseek _lseek
292 #define popen _popen
293 #define pclose _pclose
294 #define umask _umask
295 #define utimbuf _utimbuf
296 #define index strchr
297 #define rindex strrchr
298 #define strdup _strdup
299 #define strupr _strupr
300 #define strnicmp _strnicmp
301 #define stricmp _stricmp
302 #define tzset _tzset
303
304 #if !defined (_MSC_VER) || (_MSC_VER < 1400)
305 #define tzname _tzname
306 #define utime _utime
307 #endif
308
309 /* this is hacky, but is necessary to avoid warnings about macro
310 redefinitions using the SDK compilers */
311 #ifndef __STDC__
312 #define __STDC__ 1
313 #define MUST_UNDEF__STDC__
314 #endif
315 #include <direct.h>
316 #include <io.h>
317 #include <stdio.h>
318 #ifdef MUST_UNDEF__STDC__
319 #undef __STDC__
320 #undef MUST_UNDEF__STDC__
321 #endif
322
323 /* Defines that we need that aren't in the standard signal.h */
324 #define SIGHUP 1 /* Hang up */
325 #define SIGQUIT 3 /* Quit process */
326 #define SIGTRAP 5 /* Trace trap */
327 #define SIGKILL 9 /* Die, die die */
328 #define SIGPIPE 13 /* Write on pipe with no readers */
329 #define SIGALRM 14 /* Alarm */
330 #define SIGCHLD 18 /* Death of child */
331
332 #ifndef NSIG
333 #define NSIG 23
334 #endif
335
336 /* For integration with MSDOS support. */
337 #define getdisk() (_getdrive () - 1)
338 #ifdef emacs
339 #define getdefdir(_drv, _buf) ((_buf[0] = (_drv + 'A' - 1), _buf[1] = ':', _buf[2] = '/', _buf[3] = 0), 1)
340 #else
341 #define getdefdir(_drv, _buf) _getdcwd (_drv, _buf, MAXPATHLEN)
342 #endif
343
344 extern char *get_emacs_configuration (void);
345 extern char *get_emacs_configuration_options (void);
346 #define EMACS_CONFIGURATION get_emacs_configuration ()
347 #define EMACS_CONFIG_OPTIONS get_emacs_configuration_options ()
348
349 /* Define this so that winsock.h definitions don't get included with
350 windows.h. For this to have proper effect, config.h must always be
351 included before windows.h. */
352 #define _WINSOCKAPI_ 1
353 #define _WINSOCK_H
354
355 /* Defines size_t and alloca (). */
356 #ifdef USE_CRT_DLL
357 #define malloc e_malloc
358 #define free e_free
359 #define realloc e_realloc
360 #define calloc e_calloc
361 #endif
362 #include <malloc.h>
363
364 #include <sys/stat.h>
365
366 /* Define for those source files that do not include enough NT
367 system files. */
368 #ifndef NULL
369 #ifdef __cplusplus
370 #define NULL 0
371 #else
372 #define NULL ((void *)0)
373 #endif
374 #endif
375
376 /* For proper declaration of environ. */
377 #include <stdlib.h>
378 #ifndef sys_nerr
379 #define sys_nerr _sys_nerr
380 #endif
381 #include <string.h>
382
383 /* We need a little extra space, see ../../lisp/loadup.el. */
384 #define SYSTEM_PURESIZE_EXTRA 50000
385
386 /* For unexec to work on Alpha systems, we need to put Emacs'
387 initialized data into a separate section from the CRT initialized
388 data (because the Alpha linker freely reorders data variables, even
389 across libraries, so our data and the CRT data get intermingled).
390
391 Starting with MSVC 5.0, we must also place the uninitialized data
392 into its own section. VC5 intermingles uninitialized data from the CRT
393 between Emacs' static uninitialized data and its public uninitialized
394 data. A separate .bss section for Emacs groups both static and
395 public uninitialized together.
396
397 Note that unexw32.c relies on this fact, and must be modified
398 accordingly if this section name is changed, or if this pragma is
399 removed. Also, obviously, all files that define initialized data
400 must include config.h to pick up this pragma. */
401
402 /* Names must be < 8 bytes */
403 #ifdef _MSC_VER
404 #pragma data_seg("EMDATA")
405 #pragma bss_seg("EMBSS")
406 #endif
407
408 /* #define FULL_DEBUG */
409 /* #define EMACSDEBUG */
410
411 #ifdef EMACSDEBUG
412 extern void _DebPrint (const char *fmt, ...);
413 #define DebPrint(stuff) _DebPrint stuff
414 #else
415 #define DebPrint(stuff)
416 #endif
417
418
419 /* ============================================================ */
420
421 /* arch-tag: 5d4a3a1c-40dc-4dea-9c7c-38fed9ae0eae
422 (do not change this comment) */