forked from quozl/netrek-client-cow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.h.in
526 lines (437 loc) · 12 KB
/
config.h.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
/* Netrek Configuration file - by Kurt Siegl
*
*/
#ifndef __CONFIG_H
#define __CONFIG_H
/*
################################################################################
All The fun defines
################################################################################
*/
/*
Defines
Some possible values:
NOTE: Only NON-system specific defines belong here
*/
/*
------------------------------------------------------------
Common defines
------------------------------------------------------------
*/
#define RCD /* RCD - Support Reciever variable
distresses */
/* PING - Ping statistics */
#define PING
/* SHORT_PACKETS - Reduce Network load */
#define SHORT_PACKETS
/* SPEEDUP - Misc improvements to make
the code faster */
#define SPEEDUP
/* FEATURE_PACKETS - feature packets */
#define FEATURE_PACKETS
/* UDP_PORTSWAP - Allow the client to
initiate the UDP connection first if it so
chooses. This allows UDP connections through
some packet filtering firewalls.
*/
#define UDP_PORTSWAP
/* DEBUG - Various useful debugging
stuff. No signal trap */
#undef DEBUG
/*
------------------------------------------------------------
COW only defines
------------------------------------------------------------
*/
/* NBT - Nick trown's macro code */
#define NBT
/* MAXPLAYER - Maximal number of players + observers */
#define MAXPLAYER 36
/* CORRUPTED_PACKETS - prevents some seg faults but verbose output */
#define CORRUPTED_PACKETS
/* EXPIRE=# - number of days this version will work for */
#if 0 /* ndef STABLE expire function removed */
#define EXPIRE 365
#endif
/* ARMY_SLIDER - some sort of funky status window thing */
#define ARMY_SLIDER
/* META - show active servers via metaserver - NBT */
#define META
/* PACKET_LOG - log packets to stdout (for bandwith measurement) */
#define PACKET_LOG
/* NEWMACRO - newmacro language */
#define NEWMACRO
/* SMARTMACRO - macro extension (needs NEWMACRO) */
#define SMARTMACRO
/* MULTILINE_MACROS - enables multiline macros */
#define MULTILINE_MACROS
/* XTREKRC_HELP - Hadley's xtrekrc window (stolden by KP) */
#define XTREKRC_HELP
/* TOOLS - Various tools, like shell escape, ... */
#define TOOLS
/* SOUND - support of external sound players */
/* Autodetect may discover sound releated problems like cygwin has no shm */
#undef SKIP_SOUND
#ifndef SKIP_SOUND
#define SOUND
#endif
/* HOCKEY_LINES - allow showing of hockey lines */
#define HOCKEY_LINES
/* BEEPLITE - player and planets highlighting */
#define BEEPLITE
/* VSHIELD_BITMAPS - damage dependent shields (hull) */
#define VSHIELD_BITMAPS
#define VARY_HULL
/* WARP_DEAD - Use death detection
*/
#undef WARP_DEAD
/* RCM - Receiver configurable Server messages */
#define RCM
/* RACE_COLORS - additional bitplane for race colors */
#define RACE_COLORS
/* XTRA_MESSAGE_UI - Show message being typed on the local display */
#define XTRA_MESSAGE_UI
/* SYSTEM_DEFAULTFILE - Points to a system wide .xtrekrc file */
#define SYSTEM_DEFAULTFILE "/etc/netrek-client-cow/netrekrc"
/* WINDOWMAKER - WindowMaker Docking support */
#ifdef linux
#define WINDOWMAKER
#endif
#define PLIST1
#define PLIST
#define CONTROL_KEY
#define DOC_WIN
#define ROTATERACE
#define FUNCTION_KEYS
/* client options */
#define IGNORE_SIGNALS_SEGV_BUS
#define MOUSE_AS_SHIFT
#define SHIFTED_MOUSE
#define TNG_FED_BITMAPS
#define MOTION_MOUSE
#define DIST_KEY_NAME
#define PHASER_STATS
#define RECORDGAME
#define CAMERA
#define FULLSCREEN
/*
##############################################################################
All system dependencies should be defined here
##############################################################################
*/
#define NEED_EXIT
/* Automatic generated system dependend defines */
#undef HAVE_MATH_H
#undef HAVE_STDLIB_H
#undef _ALL_SOURCES
#undef HAVE_SYS_SIGNAL_H
#undef BSD_SIGNALS
#undef SYSV_SIGNALS
#undef POSIX_SIGNALS
#undef RESTARTABLE_SYSCALLS
#undef NEED_MEMORY_H
#define STDC_HEADERS 1 /* 13/01/94 omit hosed index [007] */
#undef HAVE_WAIT3
#undef NEED_SYS_SELECT_H
#undef NO_FD_SET /* Guess we suck badly if that happens :( */
#undef HAVE_UNISTD_H
#undef HAVE_SYS_TIMEB_H
#undef TM_IN_SYS_TIME
#undef TIME_WITH_SYS_TIME
#undef NEED_SYS_TIME_H
#undef HAVE_SYS_PTYIO_H
#undef HAVE_SYS_FCNTL_H
#undef HAVE_FCNTL_H
#undef HAVE_CTYPE_H
#undef HAVE_MACHINE_ENDIAN_H
#undef HAVE_SYS_RESOURCE_H
#undef HAVE_SYS_WAIT_H
#undef HAVE_NETINET_IN_H
#undef HAVE_NETINET_TCP_H
#undef HAVE_SYS_FILIO_H /* Needed for Solaris 2.5.1 */
#undef HAVE_GMP2_H
#undef NO_U_INT
#undef SIZEOF_LONG
#undef HAVE_USLEEP
#undef HAVE_SETSTATE
#undef HAVE_RANDOM
#undef HAVE_STRFTIME
#undef HAVE_FTIME
#undef HAVE_STRCMPI
#undef HAVE_STRNCMPI
#undef HAVE_NINT
#undef NEED_RINT_DEC
#undef RETSIGTYPE
#undef pid_t
#undef uid_t
#undef gid_t
#undef size_t
#undef vfork
#if (defined(sparc) && defined(sun))
#define vfork fork
#endif
#undef NO_PATH_MAX
#undef inline
#undef HAVE_X11
#undef HAVE_WIN32
#undef HAVE_XPM
#undef HAVE_X11_XPM_H
/* System dependend macros */
/* SYSV signal handling */
#ifdef SYSV_SIGNALS
#include <signal.h>
#define SIGNAL(x,y) sigset(x,y)
#define PAUSE(x) sigpause(x)
#define SIGSETMASK(x) { }
#else
#define SIGNAL(x,y) signal(x,y)
#define PAUSE(x) pause()
#define SIGSETMASK(x) sigsetmask(x)
#endif
#ifdef POSIX_SIGNALS
#define HANDLE_SIG(s,h) signal(s,h)
#define setjmp(x) sigsetjmp(x,1)
#define longjmp(x,y) siglongjmp(x,y)
#else
#define HANDLE_SIG(s,h) {}
#endif
#ifdef STDC_HEADERS
#define INC_STRINGS <string.h>
#else
#define INC_STRINGS <strings.h>
#endif
#ifdef STDC_HEADERS
#define MCMP(x,y,z) memcmp(x,y,z)
#define MCOPY(b1,b2,l) memcpy(b2,b1,l)
#define MZERO(b1,l) memset(b1,0,l)
#define INDEX(s,c) strchr(s,c)
#define RINDEX(s,c) strrchr(s,c)
#else
#define INDEX(s,c) index(s,c)
#define RINDEX(s,c) rindex(s,c)
#define MCMP(x,y,z) bcmp(x,y,z)
#define MCOPY(b1,b2,l) bcopy(b1,b2,l)
#define MZERO(b1,l) bzero(b1,l)
#endif
#ifdef SPEEDUP /* strncpy is terrible slow */
#ifdef NEED_MEMORY_H
#include <memory.h>
#else
#include <string.h>
#endif
/* #define STRNCPY(x,y,z) memcpy(x,y,z) */
#define STRNCPY(x,y,z) memccpy(x,y,'\0',z)
#else
#define STRNCPY(x,y,z) strncpy(x,y,z)
#endif
#ifndef HAVE_WAIT3
#define WAIT3(x,y,z) waitpid(-1, x, y )
#else
#define WAIT3(x,y,z) wait3(x, y, z)
#endif
#if (defined(HAVE_RANDOM) && defined(HAVE_SETSTATE)) || !defined(HAVE_RANDOM)
#define RANDOM() random()
#define SRANDOM(x) srandom(x)
#else
#define RANDOM() rrandom()
#define SRANDOM(x) ssrandom(x)
extern void ssrandom ();
extern long rrandom ();
#endif
#if !defined(HAVE_RANDOM)
extern void srandom ();
extern long random ();
#endif
#if (SIZEOF_LONG == 8)
#define _64BIT
#define LONG int
#define U_LONG u_int
#else
#define LONG long
#define U_LONG u_long
#endif
/* System dependend Include files */
#define NULLFILE "null"
#ifdef NEED_SYS_SELECT_H
#define INC_SYS_SELECT <sys/select.h>
#else
#define INC_SYS_SELECT NULLFILE
#endif
#define SELECT select
#ifdef HAVE_UNISTD_H
#define INC_UNISTD <unistd.h>
#else
#define INC_UNISTD NULLFILE
#endif
#ifdef HAVE_SYS_SIGNAL_H
#define INC_SYS_SIGNAL <sys/signal.h>
#else
#define INC_SYS_SIGNAL NULLFILE
#endif
#ifdef HAVE_SYS_FCNTL_H
#define INC_SYS_FCNTL <sys/fcntl.h>
#else
#define INC_SYS_FCNTL NULLFILE
#endif
#ifdef HAVE_FCNTL_H
#define INC_FCNTL <fcntl.h>
#else
#define INC_FCNTL NULLFILE
#endif
/* Some systems don't include <sys/time.h> in <time.h> */
#if defined(TM_IN_SYS_TIME) || defined(NEED_SYS_TIME_H)
#define INC_SYS_TIME <sys/time.h>
#else
#define INC_SYS_TIME NULLFILE
#endif
#ifdef HAVE_SYS_PTYIO_H
#define INC_SYS_PTYIO <sys/ptyio.h>
#else
#define INC_SYS_PTYIO NULLFILE
#endif
#ifdef HAVE_CTYPE_H
#define INC_CTYPE <ctype.h>
#else
#define INC_CTYPE NULLFILE
#endif
#ifdef HAVE_MACHINE_ENDIAN_H
#define INC_MACHINE_ENDIAN <machine/endian.h>
#else
#define INC_MACHINE_ENDIAN NULLFILE
#endif
#ifdef HAVE_SYS_RESOURCE_H
#define INC_SYS_RESOURCE <sys/resource.h>
#else
#define INC_SYS_RESOURCE NULLFILE
#endif
#ifdef HAVE_SYS_WAIT_H
#define INC_SYS_WAIT <sys/wait.h>
#else
#define INC_SYS_WAIT NULLFILE
#endif
#ifdef HAVE_NETINET_IN_H
#define INC_NETINET_IN <netinet/in.h>
#else
#define INC_NETINET_IN NULLFILE
#endif
#ifdef HAVE_NETINET_TCP_H
#define INC_NETINET_TCP <netinet/tcp.h>
#else
#define INC_NETINET_TCP NULLFILE
#endif
/* Replace outdated ftime with gettimeofday */
#if defined(HAVE_SYS_TIMEB_H) && defined(HAVE_FTIME)
#define INC_SYS_TIMEB <sys/timeb.h>
#else
#define NOTIMEB
#define INC_SYS_TIMEB <sys/time.h>
#endif
#ifdef HAVE_GMP2_H
#define INC_MP <gmp.h>
#define MPTYPEDEF typedef mpz_t MPTYPE;
#define assignItom(x,i) {mpz_init(x); mpz_set_ui(x,i);}
#define madd(x, y, z) mpz_add(z, x, y)
#define msub(x, y, z) mpz_sub(z, x, y)
#define mult(x, y, z) mpz_mul(z, x, y)
#define mdiv(n, d, q, r) mpz_fdiv_qr(q, r, n, d)
#define sdiv(n, d, q, r) *r = mpz_fdiv_q_ui(q, n, d)
#define msqrt(x, y, z) mpz_sqrt(z, x, y)
#define mp_pow(x, y, z, a) mpz_powm(a, x, y, z)
#define gcd(x, y, z) mpz_gcd(z, x, y)
#define mcmp(x, y) mpz_cmp(x, y)
#define min(x) mpz_min(x)
#define mout(x) mpz_mout(x)
#define mfree(x) mpz_clear(x)
#else
#define MPTYPEDEF typedef MINT *MPTYPE;
#define assignItom(x,i) x= itom(i)
#define mp_pow(x, y, z, a) pow(x, y, z, a)
#define INC_MP <mp.h>
#endif
#ifdef NO_PATH_MAX
#define PATH_MAX 255
#define INC_LIMITS NULLFILE
#else
#define INC_LIMITS <limits.h>
#endif
#ifdef HAVE_XPM
#ifdef HAVE_X11_XPM_H
#define INC_XPM <X11/xpm.h>
#else
#define INC_XPM <xpm.h>
#endif
#else
#define INC_XPM NULLFILE
#endif
/* Unchecked machine dependencies */
#ifdef linux
#define SHMFLAG sizeof(struct memory)
#else
#define SHMFLAG 0
#endif
#if defined(sun3)
#define INC_STDLIB NULLFILE
#else
#define INC_STDLIB <stdlib.h>
#endif
#ifndef sun4
#if defined(HAVE_NINT) && defined(HAVE_MATH_H)
#define INC_MATH <math.h>
#else
#if defined(NEED_RINT_DEC)
extern double rint(double);
#define INC_MATH NULLFILE
#else
#define INC_MATH <math.h>
#endif
#define nint(x) ((int) rint(x))
#endif
#endif
/*
Some systems, most notably SunOS 4.1.3, don't include function definitions
in the libraries. This results in some warning we don't want.
This header defines the type for all these functions.
*/
#ifdef sun4
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
int close(int);
int connect(int, struct sockaddr *, int);
int fprintf(FILE *, const char *, ...);
int fputs(char *, FILE *);
char *memccpy(char *, char *, int, int);
int perror(char *);
int socket(int, int, int);
int sscanf(char *, char *, ...);
char *strdup(char *arg);
char _filbuf(FILE *);
int _flsbuf(unsigned char, FILE *);
#endif /* defined sun4 */
#ifdef WIN32
typedef unsigned short int ushort;
#define strncasecmp strncmp
#ifdef THREADED
#define THREAD(fn) { DWORD junk; CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)f
#define ENDTHREAD ExitThread(0);
typedef unsigned long int SEMAPHORE;
#define CREATE_SEMAPHORE(initstate) CreateEvent(NULL, 1, initstate, NULL)
#define SET_SEMAPHORE(sem) SetEvent((HANDLE)sem)
#define RESET_SEMAPHORE(sem) ResetEvent((HANDLE)sem)
#endif
#endif
#ifdef _MSC_VER
#define INC_STRINGS <ntstring.h>
#define INC_IO <ntio.h>
#else
#define INC_IO NULLFILE
#endif
/* Solaris specific stuff */
#if defined(HAVE_SYS_FILIO_H)
#define INC_SYS_FILIO <sys/filio.h>
#else
#define INC_SYS_FILIO NULLFILE
#endif
/* define this if you have the SDL library (checked by configure.in) */
#undef HAVE_SDL
#endif /* __CONFIG_H */