1 /* System description file for Windows NT.
3 Copyright (C) 1993-1995, 2001-2012 Free Software Foundation, Inc.
5 This file is part of GNU Emacs.
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.
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.
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/>. */
20 /* Define symbols to identify the version of Unix this is.
21 Define all the symbols that apply correctly. */
27 #define DOS_NT /* MSDOS or WINDOWSNT */
30 /* If you are compiling with a non-C calling convention but need to
31 declare vararg routines differently, put it here. */
32 #define _VARARGS_ __cdecl
34 /* If you are providing a function to something that will call the
35 function back (like a signal handler and signal, or main) its calling
36 convention must be whatever standard the libraries expect. */
37 #define _CALLBACK_ __cdecl
41 /* Letter to use in finding device name of first pty,
42 if system supports pty's. 'a' means it is /dev/ptya0 */
43 #define FIRST_PTY_LETTER 'a'
45 /* Define HAVE_TIMEVAL if the system supports the BSD style clock values.
46 Look in <sys/time.h> for a timeval structure. */
47 #define HAVE_TIMEVAL 1
49 /* NT supports Winsock which is close enough (with some hacks). */
50 #define HAVE_SOCKETS 1
52 /* But our select implementation doesn't allow us to make non-blocking
53 connects. So until that is fixed, this is necessary: */
54 #define BROKEN_NON_BLOCKING_CONNECT 1
56 /* And the select implementation does 1-byte read-ahead waiting
57 for received packets, so datagrams are broken too. */
58 #define BROKEN_DATAGRAM_SOCKETS 1
60 #define MAIL_USE_POP 1
61 #define MAIL_USE_SYSTEM_LOCK 1
63 /* If the character used to separate elements of the executable path
64 is not ':', #define this to be the appropriate character constant. */
67 #define ORDINARY_LINK 1
69 /* ============================================================ */
71 /* Here, add any special hacks needed to make Emacs work on this
72 system. For example, you might define certain system call names
73 that don't exist on your system, or that do different things on
74 your system and must be used only through an encapsulation (which
75 you should place, by convention, in sysdep.c). */
77 /* Define this to be the separator between devices and paths. */
78 #define DEVICE_SEP ':'
80 /* We'll support either convention on NT. */
81 #define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\')
82 #define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_))
84 #include <sys/types.h>
87 typedef unsigned long sigset_t
;
93 void (*sa_handler
)(int);
100 /* The null device on Windows NT. */
101 #define NULL_DEVICE "NUL:"
104 #define MAXPATHLEN _MAX_PATH
108 #define LISP_FLOAT_TYPE 1
110 #define HAVE_SYS_TIMEB_H 1
111 #define HAVE_SYS_TIME_H 1
112 #define HAVE_UNISTD_H 1
114 #undef HAVE_LINUX_VERSION_H
115 #undef HAVE_SYS_SYSTEMINFO_H
117 #define TIME_WITH_SYS_TIME 1
119 #define HAVE_GETTIMEOFDAY 1
120 #define HAVE_GETHOSTNAME 1
122 #define HAVE_RENAME 1
123 #define HAVE_CLOSEDIR 1
124 #define HAVE_FSYNC 1 /* fsync is called _commit in MSVC. */
126 #undef TM_IN_SYS_TIME
129 #define HAVE_LONG_FILE_NAMES 1
133 #define HAVE_RANDOM 1
136 #define HAVE_MEMCMP 1
137 #define HAVE_MEMCPY 1
138 #define HAVE_MEMMOVE 1
139 #define HAVE_MEMSET 1
145 #undef HAVE_RES_INIT /* For -lresolv on Suns. */
147 #undef HAVE_FPATHCONF
148 #define HAVE_SELECT 1
149 #undef HAVE_EUIDACCESS
150 #define HAVE_GETPAGESIZE 1
152 #define HAVE_SETLOCALE 1
154 #undef HAVE_SETRLIMIT
156 /* If you think about defining HAVE_GETCWD, don't: the alternative
157 getwd is redefined on w32.c, and does not really return the current
158 directory, to get the desired results elsewhere in Emacs */
160 #define HAVE_SHUTDOWN 1
162 #define LOCALTIME_CACHE
163 #define HAVE_INET_SOCKETS 1
165 #undef HAVE_AIX_SMT_EXP
166 #define USE_TOOLKIT_SCROLL_BARS 1
168 /* Define if you have the ANSI `strerror' function.
169 Otherwise you must have the variable `char *sys_errlist[]'. */
170 #define HAVE_STRERROR 1
172 /* Define if `struct utimbuf' is declared by <utime.h>. */
173 #undef HAVE_STRUCT_UTIMBUF
176 #define HAVE_H_ERRNO 1
179 #define HAVE_WINDOW_SYSTEM 1
183 /* Get some redefinitions in place. */
188 #include <sys/timeb.h>
189 #include <sys/stat.h>
192 /* MSVC gets link-time errors without these redirections. */
193 #define fstat(a, b) sys_fstat(a, b)
194 #define stat(a, b) sys_stat(a, b)
195 #define utime sys_utime
198 /* Calls that are emulated or shadowed. */
200 #define access sys_access
202 #define chdir sys_chdir
204 #define chmod sys_chmod
205 #define chown sys_chown
207 #define close sys_close
209 #define creat sys_creat
210 #define ctime sys_ctime
214 #define dup2 sys_dup2
215 #define fopen sys_fopen
216 #define link sys_link
217 #define localtime sys_localtime
218 #define mkdir sys_mkdir
220 #define mktemp sys_mktemp
222 #define open sys_open
223 #define pipe sys_pipe
225 #define read sys_read
226 #define rename sys_rename
227 #define rmdir sys_rmdir
228 #define select sys_select
229 #define sleep sys_sleep
230 #define strerror sys_strerror
232 #define unlink sys_unlink
234 #define write sys_write
236 /* Subprocess calls that are emulated. */
237 #define spawnve sys_spawnve
238 #define wait sys_wait
239 #define kill sys_kill
240 #define signal sys_signal
242 /* termcap.c calls that are emulated. */
243 #define tputs sys_tputs
244 #define tgetstr sys_tgetstr
246 /* cm.c calls that are emulated. */
247 #define chcheckmagic sys_chcheckmagic
248 #define cmcostinit sys_cmcostinit
249 #define cmgoto sys_cmgoto
250 #define cmputc sys_cmputc
251 #define Wcm_clear sys_Wcm_clear
255 /* Map to MSVC names. */
256 #define execlp _execlp
257 #define execvp _execvp
258 #define fdopen _fdopen
260 #define fileno _fileno
262 #define fsync _commit
263 #define ftruncate _chsize
264 #define getpid _getpid
267 #define snprintf _snprintf
268 #define strtoll _strtoi64
270 #define isatty _isatty
272 #define _longjmp longjmp
275 #define pclose _pclose
278 #define utimbuf _utimbuf
280 #define strdup _strdup
281 #define strupr _strupr
282 #define strnicmp _strnicmp
283 #define stricmp _stricmp
286 /* Include time.h before redirecting tzname, since MSVC's time.h
287 defines _tzname to call a function, but also declares tzname a
288 2-element array. Having the redirection before including the
289 header thus has the effect of declaring a function that returns an
290 array, and triggers an error message. */
292 #define tzname _tzname
293 #if !defined (_MSC_VER) || (_MSC_VER < 1400)
298 /* This is hacky, but is necessary to avoid warnings about macro
299 redefinitions using the SDK compilers. */
302 #define MUST_UNDEF__STDC__
307 #ifdef MUST_UNDEF__STDC__
309 #undef MUST_UNDEF__STDC__
312 /* Defines that we need that aren't in the standard signal.h. */
313 #define SIGHUP 1 /* Hang up */
314 #define SIGQUIT 3 /* Quit process */
315 #define SIGTRAP 5 /* Trace trap */
316 #define SIGKILL 9 /* Die, die die */
317 #define SIGPIPE 13 /* Write on pipe with no readers */
318 #define SIGALRM 14 /* Alarm */
319 #define SIGCHLD 18 /* Death of child */
325 /* For integration with MSDOS support. */
326 #define getdisk() (_getdrive () - 1)
328 #define getdefdir(_drv, _buf) ((_buf[0] = (_drv + 'A' - 1), _buf[1] = ':', _buf[2] = '/', _buf[3] = 0), 1)
330 #define getdefdir(_drv, _buf) _getdcwd (_drv, _buf, MAXPATHLEN)
333 extern char *get_emacs_configuration (void);
334 extern char *get_emacs_configuration_options (void);
335 #define EMACS_CONFIGURATION get_emacs_configuration ()
336 #define EMACS_CONFIG_OPTIONS get_emacs_configuration_options ()
338 /* Define this so that winsock.h definitions don't get included with
339 windows.h. For this to have proper effect, config.h must always be
340 included before windows.h. */
341 #define _WINSOCKAPI_ 1
344 /* Defines size_t and alloca (). */
346 #define malloc e_malloc
348 #define realloc e_realloc
349 #define calloc e_calloc
352 #define alloca _alloca
357 #include <sys/stat.h>
359 /* Define for those source files that do not include enough NT system files. */
364 #define NULL ((void *)0)
368 /* For proper declaration of environ. */
371 #define sys_nerr _sys_nerr
375 extern int getloadavg (double *, int);
377 /* We need a little extra space, see ../../lisp/loadup.el. */
378 #define SYSTEM_PURESIZE_EXTRA 50000
380 #define DATA_START get_data_start ()
382 /* For unexec to work on Alpha systems, we need to put Emacs'
383 initialized data into a separate section from the CRT initialized
384 data (because the Alpha linker freely reorders data variables, even
385 across libraries, so our data and the CRT data get intermingled).
387 Starting with MSVC 5.0, we must also place the uninitialized data
388 into its own section. VC5 intermingles uninitialized data from the CRT
389 between Emacs' static uninitialized data and its public uninitialized
390 data. A separate .bss section for Emacs groups both static and
391 public uninitialized together.
393 Note that unexw32.c relies on this fact, and must be modified
394 accordingly if this section name is changed, or if this pragma is
395 removed. Also, obviously, all files that define initialized data
396 must include config.h to pick up this pragma. */
398 /* Names must be < 8 bytes. */
400 #pragma data_seg("EMDATA")
401 #pragma bss_seg("EMBSS")
404 /* #define FULL_DEBUG */
405 /* #define EMACSDEBUG */
408 extern void _DebPrint (const char *fmt
, ...);
409 #define DebPrint(stuff) _DebPrint stuff
411 #define DebPrint(stuff)
415 /* ============================================================ */