This commit was generated by cvs2svn to compensate for changes in r5670,
[chise/xemacs-chise.git.1] / src / s / mingw32.h
1 /* system description file for mingw32.
2    Copyright (C) 1993, 1994, 1995, 1999 Free Software Foundation, Inc.
3
4 This file is part of GNU Emacs.
5
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)
9 any later version.
10
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.
15
16 You should have received a copy of the GNU General Public License
17 along with XEmacs; 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.  */
20
21 /* based on cygwin32.h by Andy Piper <andy@xemacs.org> */
22
23 #ifndef WINDOWSNT
24 #define WINDOWSNT
25 #endif
26
27 #ifndef DOS_NT
28 #define DOS_NT  /* MSDOS or WINDOWSNT */
29 #endif
30
31 #define PBS_SMOOTH              0x01
32
33 #ifdef HAVE_MS_WINDOWS
34 #define HAVE_NTGUI
35 #define HAVE_FACES
36 #endif
37
38 #ifndef ORDINARY_LINK
39 #define ORDINARY_LINK
40 #endif
41
42 #define C_SWITCH_SYSTEM "-mno-cygwin -Wno-sign-compare -fno-caller-saves -Int/inc -I../nt/inc -DWINDOWSNT"
43 #define LIBS_SYSTEM "-mno-cygwin -lwinmm -lwsock32"
44
45 #define TEXT_START -1
46 #define TEXT_END -1
47 #define DATA_END -1
48 #define HEAP_IN_DATA
49 #define UNEXEC "unexcw.o"
50
51 #define TIME_ONESHOT 0
52 #define TIME_PERIODIC 1
53 #define LOCALE_USE_CP_ACP 0x40000000
54 #define SHGFI_EXETYPE 0x2000
55 #define NSIG 23
56
57 /* translate NT world unexec stuff to our a.out definitions */
58
59 #define strnicmp strncasecmp
60 /* #ifndef HAVE_SOCKETS */
61 #define HAVE_SOCKETS
62 /* #endif */
63 #define OBJECTS_SYSTEM  ntplay.o nt.o ntheap.o ntproc.o dired-msw.o
64 #define HAVE_NATIVE_SOUND
65
66 #undef MAIL_USE_SYSTEM_LOCK
67 #define MAIL_USE_POP
68 #define HAVE_MSW_C_DIRED
69
70 /* Define NO_ARG_ARRAY if you cannot take the address of the first of a
71  * group of arguments and treat it as an array of the arguments.  */
72
73 #define NO_ARG_ARRAY
74
75 /* Define WORD_MACHINE if addresses and such have
76  * to be corrected before they can be used as byte counts.  */
77
78 #define WORD_MACHINE
79
80 /* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend
81    the 24-bit bit field into an int.  In other words, if bit fields
82    are always unsigned.
83
84    If you use NO_UNION_TYPE, this flag does not matter.  */
85
86 #define EXPLICIT_SIGN_EXTEND
87 /* System calls that are encapsulated */
88 #define ENCAPSULATE_RENAME
89 #define ENCAPSULATE_OPEN
90 #define ENCAPSULATE_FOPEN
91 #define ENCAPSULATE_MKDIR
92
93 /* Data type of load average, as read out of kmem.  */
94
95 #define LOAD_AVE_TYPE long
96
97 /* Convert that into an integer that is 100 for a load average of 1.0  */
98
99 #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
100
101 /* Define VIRT_ADDR_VARIES if the virtual addresses of
102    pure and impure space as loaded can vary, and even their
103    relative order cannot be relied on.
104
105    Otherwise Emacs assumes that text space precedes data space,
106    numerically.  */
107
108 /* Text does precede data space, but this is never a safe assumption.  */
109 #define VIRT_ADDR_VARIES
110
111 /* set this if you have a new version of cygwin
112 #define DATA_SEG_BITS 0x10000000
113 */
114
115 /* If you are compiling with a non-C calling convention but need to
116    declare vararg routines differently, put it here */
117 #define _VARARGS_ __cdecl
118
119 /* If you are providing a function to something that will call the
120    function back (like a signal handler and signal, or main) its calling
121    convention must be whatever standard the libraries expect */
122 #define _CALLBACK_ __cdecl
123
124 /* SYSTEM_TYPE should indicate the kind of system you are using.
125  It sets the Lisp variable system-type.  */
126
127 #define SYSTEM_TYPE "windows-nt"
128
129 #define NO_MATHERR
130
131 /* define MAIL_USE_FLOCK if the mailer uses flock
132    to interlock access to /usr/spool/mail/$USER.
133    The alternative is that a lock file named
134    /usr/spool/mail/$USER.lock.  */
135
136 /* If the character used to separate elements of the executable path
137    is not ':', #define this to be the appropriate character constant.  */
138 #define SEPCHAR ';'
139
140 /* ============================================================ */
141
142 /* Here, add any special hacks needed
143    to make Emacs work on this system.  For example,
144    you might define certain system call names that don't
145    exist on your system, or that do different things on
146    your system and must be used only through an encapsulation
147    (Which you should place, by convention, in sysdep.c).  */
148
149 /* Define this to be the separator between devices and paths */
150 #define DEVICE_SEP ':'
151
152 #define DIRECTORY_SEP '\\'
153
154 /* The null device on Windows NT. */
155 #define NULL_DEVICE     "NUL:"
156 #define EXEC_SUFFIXES   ".exe:.com:.bat:.cmd:"
157 /* We'll support either convention on NT.  */
158 #define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\')
159 #define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_))
160 #define EXEC_SUFFIXES   ".exe:.com:.bat:.cmd:"
161
162 /* We need a little extra space, see ../../lisp/loadup.el */
163 #define SYSTEM_PURESIZE_EXTRA 15000
164
165 #ifndef NOT_C_CODE
166 #include <stdlib.h>
167 #include <mingw32/process.h>
168 #define mkdir __mkdir
169 #include <dir.h>
170 #undef mkdir
171 #ifdef HAVE_CYGWIN_VERSION_H
172 #include <cygwin/version.h>
173 #endif
174
175 typedef unsigned int MMRESULT;
176 typedef struct timecaps_tag {           
177   unsigned int    wPeriodMin;
178   unsigned int    wPeriodMax;
179 } TIMECAPS;
180
181 /* IO calls that are emulated or shadowed */
182 #define pipe    sys_pipe
183 int sys_pipe (int * phandles);
184
185 #ifndef HAVE_X_WINDOWS
186 #define sleep   sys_sleep
187 void sleep (int seconds);
188 #endif
189
190 /* subprocess calls that are emulated */
191 #define spawnve sys_spawnve
192 int spawnve (int mode, CONST char *cmdname, 
193              CONST char * CONST *argv, CONST char *CONST *envp);
194
195 #define wait    sys_wait
196 int wait (int *status);
197
198 #define kill    sys_kill
199 int kill (int pid, int sig);
200
201 /* map to MSVC names */
202 #define popen     _popen
203 #define pclose    _pclose
204
205 /* Encapsulation of system calls */
206 #ifndef DONT_ENCAPSULATE
207 #define getpid sys_getpid
208 int getpid (void);
209 #endif
210
211 #define DONT_USE_LITOUT
212
213 /* Random global functions called everywhere. Implemented in nt.c */
214 /* #### Most of these are FSFisms and must be avoided */
215 /* #### All of these are FSFisms and must be avoided */
216 void dostounix_filename (char *p);
217 void unixtodos_filename (char *p);
218 int crlf_to_lf (int n, unsigned char *buf, unsigned int *lf_count);
219
220 char *getwd (char *dir);
221
222 void *sbrk (unsigned long increment);
223
224 struct passwd;
225 struct passwd *getpwuid (int uid);
226 struct passwd *getpwnam (const char *name);
227 int getuid ();
228 int geteuid ();
229 int getgid (void);
230 int getegid ();
231 #define _timeb timeb
232
233 /* Stuff that gets set wrongly or otherwise */
234 #define HAVE_SETITIMER
235 #define HAVE_GETTIMEOFDAY
236 #define HAVE_SELECT
237 /*#define HAVE_STRUCT_UTIMBUF*/
238
239 #undef GETTIMEOFDAY_ONE_ARGUMENT
240 #undef HAVE_SYS_WAIT_H
241 #undef HAVE_TERMIOS
242 #undef SYSV_SYSTEM_DIR
243
244 /* We now have emulation for some signals */
245 #define HAVE_SIGHOLD
246 #define sigset(s,h) msw_sigset(s,h)
247 #define sighold(s) msw_sighold(s)
248 #define sigrelse(s) msw_sigrelse(s)
249 #define sigpause(s) msw_sigpause(s)
250 #define signal sigset
251
252 /* Defines that we need that aren't in the standard signal.h  */
253 #define SIGHUP  1               /* Hang up */
254 #define SIGQUIT 3               /* Quit process */
255 #define SIGKILL 9               /* Die, die die */
256 #define SIGALRM 14              /* Alarm */
257 #define SIGPROF 29              /* Profiling timer exp */
258
259 #ifndef MAXPATHLEN
260 #define MAXPATHLEN      _MAX_PATH
261 #endif
262
263 /* For integration with MSDOS support.  */
264 #define getdisk()               (_getdrive () - 1)
265 #define getdefdir(_drv, _buf)   _getdcwd (_drv, _buf, MAXPATHLEN)
266 #endif
267
268 /* Define for those source files that do not include enough NT 
269    system files.  */
270 #ifndef NULL
271 #ifdef __cplusplus
272 #define NULL    0
273 #else
274 #define NULL    ((void *)0)
275 #endif
276 #endif
277
278 /* Define process implementation */
279 #define HAVE_WIN32_PROCESSES
280
281 /* ============================================================ */
282