comparison src/s/windowsnt.h @ 410:de805c49cfc1 r21-2-35

Import from CVS: tag r21-2-35
author cvs
date Mon, 13 Aug 2007 11:19:21 +0200
parents 2f8bb876ab1d
children 697ef44129c6
comparison
equal deleted inserted replaced
409:301b9ebbdf3b 410:de805c49cfc1
1 /* System description file for Windows NT. 1 /* System description file for Windows 9x and NT.
2 Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc. 2 Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
3 3
4 This file is part of GNU Emacs. 4 This file is part of GNU Emacs.
5 5
6 GNU Emacs is free software; you can redistribute it and/or modify 6 GNU Emacs is free software; you can redistribute it and/or modify
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */ 19 Boston, MA 02111-1307, USA. */
20 20
21 /* Synched up with: FSF 19.31. */ 21 /* Synched up with: FSF 19.31. */
22 22
23 #ifndef WINDOWSNT 23 /* Capsule summary of different preprocessor flags:
24 #define WINDOWSNT 24
25 #endif 25 1. Keep in mind that there are two possible OS environments we are dealing
26 26 with -- Cygwin and Native Windows. Cygwin provides a POSIX emulation
27 #ifndef DOS_NT 27 layer on top of MS Windows -- in particular, providing the file-system,
28 #define DOS_NT /* MSDOS or WINDOWSNT */ 28 process, tty, and signal semantics that are part of a modern, standard
29 Unix operating system. MS Windows also provides these services, but
30 through their own API, called Win32. When compiling in a Cygwin
31 environment, the Win32 API's are also available, and in fact are used
32 to do native GUI programming.
33
34 2. There are two windowing environments we can target XEmacs for when
35 running under MS Windows -- Windows native, and X. (It may seem strange
36 to write an X application under Windows, but there are in fact many X
37 servers out there running on Windows, and as far as I know there is no
38 real (or at least, that works well) networking Window-system extension
39 under MS Windows. Furthermore, if you're porting a Unix application to
40 Windows and use Cygwin to assist you, it might seem natural to use an
41 X server to avoid having to port all the code to Windows.) For XEmacs,
42 there are various reasons people could come up with for why we would
43 want to keep maintaining X Windows under MS Windows support.
44
45 That gives us four possible build environments. I (Ben) build
46 regularly on fully-native-everything, Andy builds on Cygwin + MS
47 Windows + X Windows for windowing.
48
49 The build flags used for these divisions are:
50
51 CYGWIN -- for Cygwin-only stuff.
52 WIN32_NATIVE -- Win32 native OS-level stuff (files, process, etc.).
53 HAVE_X_WINDOWS -- for X Windows (regardless of whether under MS Win)
54 HAVE_MS_WINDOWS -- MS Windows native windowing system (anything related to
55 the appearance of the graphical screen).
56
57 Finally, there's also the MINGW build environment, which uses GCC
58 \(similar to Cygwin), but native MS Windows libraries rather than a
59 POSIX emulation layer (the Cygwin approach). This environment defines
60 WIN32_NATIVE, but also defines MINGW, which is used mostly because
61 uses its own include files (related to Cygwin), which have a few
62 things messed up.
63
64
65 Formerly, we had a whole host of flags. Here's the conversion, for porting
66 code from GNU Emacs and such:
67
68
69 WINDOWSNT -> WIN32_NATIVE
70 WIN32 -> WIN32_NATIVE
71 _WIN32 -> WIN32_NATIVE
72 HAVE_WIN32 -> WIN32_NATIVE
73 DOS_NT -> WIN32_NATIVE
74 HAVE_NTGUI -> WIN32_NATIVE, unless it ends up already bracketed by this
75 HAVE_FACES -> always true
76 MSDOS -> determine whether this code is really specific to MS-DOS (and not
77 Windows -- e.g. DJGPP code); if so, delete the code; otherwise,
78 convert to WIN32_NATIVE (we do not support MS-DOS w/DOS Extender
79 under XEmacs)
80
81 __CYGWIN__ -> CYGWIN
82 __CYGWIN32__ -> CYGWIN
83 __MINGW32__ -> MINGW
84
85 */
86
87 /* Identify ourselves */
88 #ifndef WIN32_NATIVE
89 #define WIN32_NATIVE
29 #endif 90 #endif
30 91
31 /* In case non-Microsoft compiler is used, we fake _MSC_VER */ 92 /* In case non-Microsoft compiler is used, we fake _MSC_VER */
32 #ifndef _MSC_VER 93 #ifndef _MSC_VER
33 #define _MSC_VER 1 94 #define _MSC_VER 1
165 226
166 #define HAVE_MOUSE 227 #define HAVE_MOUSE
167 #define HAVE_H_ERRNO 228 #define HAVE_H_ERRNO
168 #define HAVE_STRUCT_UTIMBUF 229 #define HAVE_STRUCT_UTIMBUF
169 230
170 #ifdef HAVE_NTGUI
171 #define HAVE_WINDOW_SYSTEM
172 #define HAVE_FACES
173 #endif
174
175 #define HAVE_STRCASECMP 231 #define HAVE_STRCASECMP
176 232
177 /* Compatibility macros. Some used to be routines in nt.c */ 233 /* Compatibility macros. Some used to be routines in nt.c */
178 #define strcasecmp(x,y) _stricmp(x,y) 234 #define strcasecmp(x,y) _stricmp(x,y)
179 #define random() (rand() << 15 | rand()) 235 #define random() (rand() << 15 | rand())
244 /* Setitimer is emulated */ 300 /* Setitimer is emulated */
245 #define HAVE_SETITIMER 301 #define HAVE_SETITIMER
246 302
247 /* We now have emulation for some signals */ 303 /* We now have emulation for some signals */
248 #define HAVE_SIGHOLD 304 #define HAVE_SIGHOLD
249 #define sigset(s,h) msw_sigset(s,h) 305 #define sigset(s,h) mswindows_sigset(s,h)
250 #define sighold(s) msw_sighold(s) 306 #define sighold(s) mswindows_sighold(s)
251 #define sigrelse(s) msw_sigrelse(s) 307 #define sigrelse(s) mswindows_sigrelse(s)
252 #define sigpause(s) msw_sigpause(s) 308 #define sigpause(s) mswindows_sigpause(s)
253 309
254 /* Defines that we need that aren't in the standard signal.h */ 310 /* Defines that we need that aren't in the standard signal.h */
255 #define SIGHUP 1 /* Hang up */ 311 #define SIGHUP 1 /* Hang up */
256 #define SIGQUIT 3 /* Quit process */ 312 #define SIGQUIT 3 /* Quit process */
257 #define SIGKILL 9 /* Die, die die */ 313 #define SIGKILL 9 /* Die, die die */
258 #define SIGALRM 14 /* Alarm */ 314 #define SIGALRM 14 /* Alarm */
259 #define SIGPROF 29 /* Profiling timer exp */ 315 #define SIGPROF 29 /* Profiling timer exp */
260
261 /* For integration with MSDOS support. */
262 #define getdisk() (_getdrive () - 1)
263 #define getdefdir(_drv, _buf) _getdcwd (_drv, _buf, MAXPATHLEN)
264 316
265 /* Defines size_t and alloca (). */ 317 /* Defines size_t and alloca (). */
266 #include <malloc.h> 318 #include <malloc.h>
267 319
268 #include <sys/stat.h> 320 #include <sys/stat.h>
310 #define DOESNT_RETURN __declspec(noreturn) void 362 #define DOESNT_RETURN __declspec(noreturn) void
311 #define DECLARE_DOESNT_RETURN(decl) __declspec(noreturn) extern void decl 363 #define DECLARE_DOESNT_RETURN(decl) __declspec(noreturn) extern void decl
312 #define DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS(decl,str,idx) \ 364 #define DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS(decl,str,idx) \
313 __declspec(noreturn) extern void decl PRINTF_ARGS(str,idx) 365 __declspec(noreturn) extern void decl PRINTF_ARGS(str,idx)
314 #endif /* MSVC 6.0 */ 366 #endif /* MSVC 6.0 */
367
368 #define CORRECT_DIR_SEPS(s) \
369 do { if ('/' == DIRECTORY_SEP) dostounix_filename (s); \
370 else unixtodos_filename (s); \
371 } while (0)