gen_defs.h 18.9 KB
Newer Older
1
2
/* General(ly useful) constant, macro, and type definitions */

3
/* $Id: gen_defs.h,v 1.85 2020/08/15 19:57:51 rswindell Exp $ */
4
// vi: tabstop=4
5
																			
6
/****************************************************************************
7
8
9
 * @format.tab-size 4           (Plain Text/Source Code File Header)        *
 * @format.use-tabs true        (see http://www.synchro.net/ptsc_hdr.html)  *
 *                                                                          *
10
 * Copyright Rob Swindell - http://www.synchro.net/copyright.html			*
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
 *                                                                          *
 * This library is free software; you can redistribute it and/or            *
 * modify it under the terms of the GNU Lesser General Public License       *
 * as published by the Free Software Foundation; either version 2           *
 * of the License, or (at your option) any later version.                   *
 * See the GNU Lesser General Public License for more details: lgpl.txt or  *
 * http://www.fsf.org/copyleft/lesser.html                                  *
 *                                                                          *
 * Anonymous FTP access to the most recent released source is available at  *
 * ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net  *
 *                                                                          *
 * Anonymous CVS access to the development source and modification history  *
 * is available at cvs.synchro.net:/cvsroot/sbbs, example:                  *
 * cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login            *
 *     (just hit return, no password is necessary)                          *
 * cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src     *
 *                                                                          *
 * For Synchronet coding style and modification guidelines, see             *
 * http://www.synchro.net/source.html                                       *
 *                                                                          *
 * You are encouraged to submit any modifications (preferably in Unix diff  *
 * format) via e-mail to mods@synchro.net                                   *
 *                                                                          *
 * Note: If this box doesn't appear square, then you need to fix your tabs. *
35
36
37
38
39
 ****************************************************************************/

#ifndef _GEN_DEFS_H
#define _GEN_DEFS_H

40
#include "cp437defs.h"
41
42
43
44
#include <errno.h>

/* Resolve multi-named errno constants */
#if defined(EDEADLK) && !defined(EDEADLOCK)
45
        #define EDEADLOCK EDEADLK
46
47
#endif

48
#if defined(_WIN32)
49
50
        #define WIN32_LEAN_AND_MEAN     /* Don't bring in excess baggage */
        #include <windows.h>
rswindell's avatar
rswindell committed
51
#elif defined(__OS2__)
52
53
        #define INCL_BASE       /* need this for DosSleep prototype */
        #include <os2.h>
54
#else
55
56
57
58
59
        #if (defined(__APPLE__) && defined(__MACH__) && defined(__POWERPC__)) || defined (__NetBSD__)
                #ifndef __unix__
                        #define __unix__
                #endif
        #endif
60
61
#endif

62
#include <ctype.h>
63
#include <sys/types.h>
deuce's avatar
deuce committed
64
#ifdef HAS_INTTYPES_H
65
66
67
#if defined __cplusplus
#define __STDC_FORMAT_MACROS
#endif
deuce's avatar
deuce committed
68
#include <inttypes.h>
69
70
71
72
#else
#ifdef HAS_STDINT_H
#include <stdint.h>
#endif
deuce's avatar
deuce committed
73
#endif
74

75
                                               /* Control characters */
76
#ifndef STX
77
#define STX     0x02                           /* Start of text                 ^B      */
78
79
#endif
#ifndef ETX
80
#define ETX     0x03                           /* End of text                   ^C      */
81
82
#endif
#ifndef BEL
83
#define BEL     0x07                            /* Bell/beep                    ^G      */
84
85
#endif
#ifndef FF
86
#define FF      0x0c                            /* Form feed                    ^L      */
87
88
#endif
#ifndef ESC
89
#define ESC     0x1b                            /* Escape                       ^[      */
90
91
#endif
#ifndef DEL
92
#define DEL     0x7f                            /* Delete                       ^BS     */
93
94
#endif
#ifndef BS
95
#define BS      '\b'                            /* Back space                   ^H      */
96
97
#endif
#ifndef TAB
98
#define TAB     '\t'                            /* Horizontal tabulation        ^I      */
99
100
#endif
#ifndef LF
101
#define LF      '\n'                            /* Line feed                    ^J      */
102
103
#endif
#ifndef CR
104
#define CR      '\r'                            /* Carriage return              ^M      */
105
106
#endif

107
#ifndef CTRL_A
108
enum {
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
	 CTRL_AT						// NUL
	,CTRL_A							// SOH
	,CTRL_B							// STX
	,CTRL_C							// ETX
	,CTRL_D							// EOT
	,CTRL_E							// ENQ
	,CTRL_F							// ACK
	,CTRL_G							// BEL
	,CTRL_H							// BS
	,CTRL_I							// HT
	,CTRL_J							// LF
	,CTRL_K							// VT
	,CTRL_L							// FF
	,CTRL_M							// CR
	,CTRL_N							// SO
	,CTRL_O							// SI
	,CTRL_P							// DLE
	,CTRL_Q							// DC1
	,CTRL_R							// DC2
	,CTRL_S							// DC3
	,CTRL_T							// DC4
	,CTRL_U							// NAK
	,CTRL_V							// SYN
	,CTRL_W							// ETB
	,CTRL_X							// CAN
	,CTRL_Y							// EM
	,CTRL_Z							// SUB
	,CTRL_OPEN_BRACKET				// ESC
	,CTRL_BACKSLASH					// FS
	,CTRL_CLOSE_BRACKET				// GS
	,CTRL_CARET						// RS
	,CTRL_UNDERSCORE				// US
	,CTRL_QUESTION_MARK	= 0x7f		// DEL
142
};
143
#endif
144

145
/* Unsigned type short-hands    */
146
#ifndef uchar
147
    #define uchar   unsigned char
148
#endif
149
150
151
152
#ifndef ushort
	#define ushort  unsigned short
	typedef unsigned int uint;			/* Incompatible with Spidermonkey header files when #define'd */
	#define ulong   unsigned long
153
154
#endif

deuce's avatar
deuce committed
155
156
157
158
159
160
161
/* Printf format specifiers... */
#if defined(_MSC_VER) || defined(__WATCOMC__) || defined(__BORLANDC__)
#define XP_PRIsize_t					"I"
#else
#define XP_PRIsize_t					"z"
#endif

162
163
164
#if !defined(HAS_INTTYPES_H) && !defined(XPDEV_DONT_DEFINE_INTTYPES)

#if !defined(HAS_STDINT_H)
165

166
typedef char    int8_t;
167
168
169
170
171
172
#ifndef INT8_MAX
#define INT8_MAX 0x7f
#endif
#ifndef INT16_MAX
#define INT16_MAX (-0x7f-1)
#endif
173
typedef short   int16_t;
174
175
176
177
178
179
#ifndef INT16_MAX
#define INT16_MAX 0x7fff
#endif
#ifndef INT16_MIN
#define INT16_MIN (-0x7fff-1)
#endif
180
typedef long    int32_t;
181
182
183
184
185
186
#ifndef INT32_MAX
#define INT32_MAX 0x7fffffff
#endif
#ifndef INT32_MIN
#define INT32_MIN (-0x7fffffff-1)
#endif
187
typedef uchar   uint8_t;
188
189
190
#ifndef UINT8_MAX
#define UINT8_MAX 0xff
#endif
191
typedef ushort  uint16_t;
192
193
194
#ifndef UINT16_MAX
#define UINT16_MAX 0xffff
#endif
195
typedef ulong   uint32_t;
196
197
#ifndef UINT32_MAX
#define UINT32_MAX 0xffffffff
198
#endif
199

200
201
#endif

202
#if !defined(_MSDOS)
203
#if defined(_MSC_VER) || defined(__WATCOMC__) || defined(__BORLANDC__)
204
typedef SSIZE_T ssize_t;
205
206
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
207
#define INTTYPES_H_64BIT_PREFIX         "I64"
208
209
210
#else
typedef signed long long int int64_t;
typedef unsigned long long int uint64_t;
211
#define INTTYPES_H_64BIT_PREFIX         "ll"
212
213
#endif

214
typedef uint64_t	uintmax_t;
215
#define _UINTMAX_T_DECLARED
216
typedef int64_t		intmax_t;
217
#define _INTMAX_T_DECLARED
218

219
#if !defined(HAS_STDINT_H) && !defined(_UINTPTR_T_DEFINED)
220
221
typedef uintmax_t	uintptr_t;
typedef intmax_t	intptr_t;
222
#endif
223
#endif // !MSDOS
224

225
226
227
228
229
230
231
232
233
/* printf integer formatters: */

#define PRId32	"d"
#define PRIu32	"u"
#define PRIi32	"i"
#define PRIx32	"x"
#define PRIX32	"X"
#define PRIo32	"o"

234
235
236
237
#define PRIi64  INTTYPES_H_64BIT_PREFIX"i"
#define PRIu64  INTTYPES_H_64BIT_PREFIX"u"
#define PRId64  INTTYPES_H_64BIT_PREFIX"d"
#define PRIx64  INTTYPES_H_64BIT_PREFIX"x"
238
#define PRIX64  INTTYPES_H_64BIT_PREFIX"X"
239
#define PRIo64  INTTYPES_H_64BIT_PREFIX"o"
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
#define PRIdMAX	PRId64
#define PRIiMAX	PRIi64
#define PRIuMAX	PRIu64
#define PRIxMAX	PRIx64
#define PRIXMAX	PRIX64
#define PRIoMAX	PRIo64

/* scanf integer formatters: */

#define SCNd32 	PRId32
#define SCNi32 	PRIi32
#define SCNu32 	PRIu32
#define SCNx32 	PRIx32
#define SCNX32 	PRIX32
#define SCNo32 	PRIo32

#define SCNd64 	PRId64
#define SCNi64 	PRIi64
#define SCNu64 	PRIu64
#define SCNx64 	PRIx64
#define SCNX64 	PRIX64
#define SCNo64 	PRIo64

#define SCNdMAX	PRId64
#define SCNiMAX	PRIi64
#define SCNuMAX	PRIu64
#define SCNxMAX	PRIx64
#define SCNXMAX	PRIX64
#define SCNoMAX	PRIo64

271
272
273
274
#else
#if (!defined(_MSDOS)) && (defined(_MSC_VER) || defined(__WATCOMC__) || defined(__BORLANDC__))
typedef SSIZE_T ssize_t;
#endif
deuce's avatar
deuce committed
275
#endif
276
277

/* Legacy 32-bit time_t */
278
typedef int32_t         time32_t;
deuce's avatar
deuce committed
279

280
#if defined(_WIN32)
281
282
283
#  if defined _MSC_VER && !defined _FILE_OFFSET_BITS
#    define _FILE_OFFSET_BITS 64
#  endif
284
#  if defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS==64)
285
286
287
#    define off_t       int64_t
#    define PRIdOFF     PRId64
#    define PRIuOFF     PRIu64
288
#  else
289
290
#    define PRIdOFF     "ld"
#    define PRIuOFF     "lu"
291
292
#  endif
#elif defined(__linux__) || defined(__sun__)
293
#  if (defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS==64)) || defined(__LP64__)
294
295
#    define PRIdOFF     PRId64
#    define PRIuOFF     PRIu64
296
#  else
297
298
#    define PRIdOFF     "ld"
#    define PRIuOFF     "lu"
299
300
#  endif
#else
301
302
#  define PRIdOFF       PRId64
#  define PRIuOFF       PRIu64
303
304
#endif

305
/* Windows Types */
306

307
#ifndef _WIN32
308
#ifndef BYTE
309
#define BYTE    uint8_t
310
311
#endif
#ifndef WORD
312
#define WORD    uint16_t
313
314
#endif
#ifndef DWORD
315
#define DWORD   uint32_t
316
317
#endif
#ifndef BOOL
318
#define BOOL    int
deuce's avatar
deuce committed
319
320
#endif

321
#ifndef TRUE
322
323
#define TRUE    1
#define FALSE   0
324
325
#endif
#ifndef HANDLE
326
#define HANDLE  void*
327
#endif
328
329
330
331
332
#endif

#ifndef INT_TO_BOOL
#define INT_TO_BOOL(x)  ((x)?TRUE:FALSE)
#endif
333

334
335
/* Custom Types */
typedef struct {
336
337
        char*   name;
        char*   value;
338
339
} named_string_t;

340
typedef struct {
341
        char*   name;
342
        int     value;
343
344
345
} named_int_t;

typedef struct {
346
347
        char*   name;
        uint    value;
348
349
350
} named_uint_t;

typedef struct {
351
352
        char*   name;
        long    value;
353
354
355
} named_long_t;

typedef struct {
356
357
        char*   name;
        ulong   value;
358
359
360
} named_ulong_t;

typedef struct {
361
362
        char*   name;
        short   value;
363
364
365
} named_short_t;

typedef struct {
366
367
        char*   name;
        ushort  value;
368
369
} named_ushort_t;

370
typedef struct {
371
372
        char*   name;
        float   value;
373
374
375
} named_float_t;

typedef struct {
376
377
        char*   name;
        double  value;
378
379
} named_double_t;

380
typedef struct {
381
382
        char*   name;
        BOOL    value;
383
384
} named_bool_t;

385
typedef struct {
386
        int     key;
387
        char*   value;
388
389
390
} keyed_string_t;

typedef struct {
391
392
        int     key;
        int     value;
393
394
395
} keyed_int_t;


396
397
398
399
400
/************************/
/* Handy Integer Macros */
/************************/

/* Data Block Length Alignment Macro (returns required padding length for proper alignment) */
401
#define PAD_LENGTH_FOR_ALIGNMENT(len,blk)       (((len)%(blk))==0 ? 0 : (blk)-((len)%(blk)))
402

403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
#define HEX_DIGITS(n)   ( n > 0xfffffff  ? 8 \
                        : n > 0x0ffffff  ? 7 \
                        : n > 0x00fffff  ? 6 \
                        : n > 0x000ffff  ? 5 \
                        : n > 0x0000fff  ? 4 \
                        : n > 0x00000ff  ? 3 \
                        : n > 0x000000f  ? 2 : 1 )
#define DEC_DIGITS(n)   ( n < 10         ? 1 \
                        : n < 100        ? 2 \
                        : n < 1000       ? 3 \
                        : n < 10000      ? 4 \
                        : n < 100000     ? 5 \
                        : n < 1000000    ? 6 \
                        : n < 10000000   ? 7 \
                        : n < 100000000  ? 8 \
                        : n < 1000000000 ? 9 : 10 )

420
421
422
423
/***********************/
/* Handy String Macros */
/***********************/

424
/* Null-Terminate an ASCIIZ char array */
425
#define TERMINATE(str)                      str[sizeof(str)-1]=0
426

427
/* This is a bound-safe version of strcpy basically - only works with fixed-length arrays */
428
#ifdef SAFECOPY_USES_SPRINTF
429
#define SAFECOPY(dst,src)                   sprintf(dst,"%.*s",(int)sizeof(dst)-1,src)
430
#else   /* strncpy is faster */
Rob Swindell's avatar
Rob Swindell committed
431
#define SAFECOPY(dst,src)                   (strncpy(dst,src,sizeof(dst)), TERMINATE(dst))
432
#endif
433

deuce's avatar
deuce committed
434
#define SAFECAT(dst, src) do { \
435
436
	if(strlen((char*)(dst)) + strlen((char*)(src)) < sizeof(dst)) { \
		strcat((char*)(dst), (char*)(src)); \
deuce's avatar
deuce committed
437
438
	} \
} while(0)
439

440
/* Bound-safe version of sprintf() - only works with fixed-length arrays */
441
442
#if (defined __FreeBSD__) || (defined __NetBSD__) || (defined __OpenBSD__) || (defined(__APPLE__) && defined(__MACH__) && defined(__POWERPC__))
/* *BSD *nprintf() is already safe */
443
444
445
446
447
448
449
450
451
#define SAFEPRINTF(dst,fmt,arg)             snprintf(dst,sizeof(dst),fmt,arg)
#define SAFEPRINTF2(dst,fmt,a1,a2)          snprintf(dst,sizeof(dst),fmt,a1,a2)
#define SAFEPRINTF3(dst,fmt,a1,a2,a3)		snprintf(dst,sizeof(dst),fmt,a1,a2,a3)
#define SAFEPRINTF4(dst,fmt,a1,a2,a3,a4)	snprintf(dst,sizeof(dst),fmt,a1,a2,a3,a4)
#else										
#define SAFEPRINTF(dst,fmt,arg)				snprintf(dst,sizeof(dst),fmt,arg), TERMINATE(dst)
#define SAFEPRINTF2(dst,fmt,a1,a2)			snprintf(dst,sizeof(dst),fmt,a1,a2), TERMINATE(dst)
#define SAFEPRINTF3(dst,fmt,a1,a2,a3)		snprintf(dst,sizeof(dst),fmt,a1,a2,a3), TERMINATE(dst)
#define SAFEPRINTF4(dst,fmt,a1,a2,a3,a4)	snprintf(dst,sizeof(dst),fmt,a1,a2,a3,a4), TERMINATE(dst)
452
#endif
453

454
/* Replace every occurrence of c1 in str with c2, using p as a temporary char pointer */
455
#define REPLACE_CHARS(str,c1,c2,p)      for((p)=(str);*(p);(p)++) if(*(p)==(c1)) *(p)=(c2);
456
457

/* ASCIIZ char* parsing helper macros */
458
/* These (unsigned char) typecasts defeat MSVC debug assertion when passed a negative value */
459
#define IS_WHITESPACE(c)				(isspace((unsigned char)(c)) || c == CP437_NO_BREAK_SPACE)
460
461
462
463
464
465
466
467
468
469
#define IS_CONTROL(c)					iscntrl((unsigned char)(c))
#define IS_ALPHA(c)						isalpha((unsigned char)(c))
#define IS_ALPHANUMERIC(c)				isalnum((unsigned char)(c))
#define IS_UPPERCASE(c)					isupper((unsigned char)(c))
#define IS_LOWERCASE(c)					islower((unsigned char)(c))
#define IS_PUNCTUATION(c)				ispunct((unsigned char)(c))
#define IS_PRINTABLE(c)					isprint((unsigned char)(c))
#define IS_DIGIT(c)						isdigit((unsigned char)(c))
#define IS_HEXDIGIT(c)					isxdigit((unsigned char)(c))
#define IS_OCTDIGIT(c)					((c) >= '0' && (c) <= '7')
470
471
472
473
474
475
#define SKIP_WHITESPACE(p)              while((p) && *(p) && IS_WHITESPACE(*(p)))        (p)++;
#define FIND_WHITESPACE(p)              while((p) && *(p) && !IS_WHITESPACE(*(p)))       (p)++;
#define SKIP_CHAR(p,c)                  while((p) && *(p)==c)                            (p)++;
#define FIND_CHAR(p,c)                  while((p) && *(p) && *(p)!=c)                    (p)++;
#define SKIP_CHARSET(p,s)               while((p) && *(p) && strchr(s,*(p))!=NULL)       (p)++;
#define FIND_CHARSET(p,s)               while((p) && *(p) && strchr(s,*(p))==NULL)       (p)++;
476
477
#define SKIP_CRLF(p)					SKIP_CHARSET(p, "\r\n")
#define FIND_CRLF(p)					FIND_CHARSET(p, "\r\n")
478
479
480
481
482
483
484
485
#define SKIP_ALPHA(p)                   while((p) && *(p) && IS_ALPHA(*(p)))             (p)++;
#define FIND_ALPHA(p)                   while((p) && *(p) && !IS_ALPHA(*(p)))            (p)++;
#define SKIP_ALPHANUMERIC(p)            while((p) && *(p) && IS_ALPHANUMERIC(*(p)))      (p)++;
#define FIND_ALPHANUMERIC(p)            while((p) && *(p) && !IS_ALPHANUMERIC(*(p)))     (p)++;
#define SKIP_DIGIT(p)                   while((p) && *(p) && IS_DIGIT(*(p)))             (p)++;
#define FIND_DIGIT(p)                   while((p) && *(p) && !IS_DIGIT(*(p)))            (p)++;
#define SKIP_HEXDIGIT(p)                while((p) && *(p) && IS_HEXDIGIT(*(p)))          (p)++;
#define FIND_HEXDIGIT(p)                while((p) && *(p) && !IS_HEXDIGIT(*(p)))         (p)++;
486

487
488
489
490
#define HEX_CHAR_TO_INT(ch) 			(((ch)&0xf)+(((ch)>>6)&1)*9)
#define DEC_CHAR_TO_INT(ch)				((ch)&0xf)
#define OCT_CHAR_TO_INT(ch)				((ch)&0x7)

491
/* Variable/buffer initialization (with zeros) */
492
493
#define ZERO_VAR(var)                           memset(&(var),0,sizeof(var))
#define ZERO_ARRAY(array)                       memset(array,0,sizeof(array))
494

495
/****************************************************************************/
496
497
498
499
500
501
502
503
/* MALLOC/FREE Macros for various compilers and environments                */
/* MALLOC is used for allocations of 64k or less                            */
/* FREE is used to free buffers allocated with MALLOC                       */
/* LMALLOC is used for allocations of possibly larger than 64k              */
/* LFREE is used to free buffers allocated with LMALLOC                     */
/* REALLOC is used to re-size a previously MALLOCed or LMALLOCed buffer     */
/* FAR16 is used to create a far (32-bit) pointer in 16-bit compilers       */
/* HUGE16 is used to create a huge (32-bit) pointer in 16-bit compilers     */
504
505
/****************************************************************************/
#if defined(__COMPACT__) || defined(__LARGE__) || defined(__HUGE__)
506
507
508
509
510
511
512
513
514
515
516
        #define HUGE16 huge
        #define FAR16 far
        #if defined(__TURBOC__)
                #define REALLOC(x,y) farrealloc(x,y)
                #define LMALLOC(x) farmalloc(x)
                #define MALLOC(x) farmalloc(x)
                #define LFREE(x) farfree(x)
                #define FREE(x) farfree(x)
        #elif defined(__WATCOMC__)
                #define REALLOC realloc
                #define LMALLOC(x) halloc(x,1)  /* far heap, but slow */
517
                #define MALLOC malloc           /* far heap, but 64k max */
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
                #define LFREE hfree
                #define FREE free
        #else   /* Other 16-bit Compiler */
                #define REALLOC realloc
                #define LMALLOC malloc
                #define MALLOC malloc
                #define LFREE free
                #define FREE free
        #endif
#else           /* 32-bit Compiler or Small Memory Model */
        #define HUGE16
        #define FAR16
        #define REALLOC realloc
        #define LMALLOC malloc
        #define MALLOC malloc
        #define LFREE free
        #define FREE free
535
536
#endif

537
538
539
/********************************/
/* Handy Pointer-freeing Macros */
/********************************/
540
541
542
543
544
545
#define FREE_AND_NULL(x)	do {                  \
								if((x)!=NULL) {   \
									FREE(x);      \
									(x)=NULL;     \
								}		          \
							} while(0)
546
#define FREE_LIST_ITEMS(list,i)         if(list!=NULL) {                                \
547
548
549
550
											for(i=0;list[i]!=NULL;i++)      \
												FREE_AND_NULL(list[i]); \
                                        }
#define FREE_LIST(list,i)               FREE_LIST_ITEMS(list,i) FREE_AND_NULL(list)
551
552

/********************************/
553
/* Other Pointer-List Macros    */
554
/********************************/
555
#define COUNT_LIST_ITEMS(list,i)        { i=0; if(list!=NULL) while(list[i]!=NULL) i++; }
556

deuce's avatar
deuce committed
557
#if defined(__unix__)
558
        #include <syslog.h>
deuce's avatar
deuce committed
559
#else
560
561
562
563
564
565
566
567
568
569
570
        /*
         * log priorities (copied from BSD syslog.h)
         */
        #define LOG_EMERG       0       /* system is unusable */
        #define LOG_ALERT       1       /* action must be taken immediately */
        #define LOG_CRIT        2       /* critical conditions */
        #define LOG_ERR         3       /* error conditions */
        #define LOG_WARNING     4       /* warning conditions */
        #define LOG_NOTICE      5       /* normal but significant condition */
        #define LOG_INFO        6       /* informational */
        #define LOG_DEBUG       7       /* debug-level messages */
deuce's avatar
deuce committed
571
572
#endif

573
#ifdef WITH_SDL_AUDIO
574
        #include <SDL.h>
575
#endif
576

577
#endif /* Don't add anything after this #endif statement */