blob: a5806b14b90628c5e5c4e16363a258734c3b781e [file] [log] [blame]
Franklin Weia855d622017-01-21 15:18:31 -05001//
2// dukerockbox.h
3// Duke3D
4//
5// Created by fabien sanglard on 12-12-12.
6// Copyright (c) 2012 fabien sanglard. All rights reserved.
7//
8
9#ifndef Duke3D_dukerb_h
10#define Duke3D_dukerb_h
11
12#include "SDL.h"
13
14#define cdecl
15#define __far
16#define __interrupt
17
18
19#define STUBBED(x)
20#ifdef __SUNPRO_C
21//#define STUBBED(x) fprintf(stderr,"STUB: %s (??? %s:%d)\n",x,__FILE__,__LINE__)
22#else
23//#define STUBBED(x) fprintf(stderr,"STUB: %s (%s, %s:%d)\n",x,__FUNCTION__,__FILE__,__LINE__)
24#endif
25
26#define PATH_SEP_CHAR '/'
27#define PATH_SEP_STR "/"
28#define ROOTDIR "/"
29#define CURDIR "/"
30
31#ifndef O_BINARY
32#define O_BINARY 0
33#endif
34
Franklin Weia855d622017-01-21 15:18:31 -050035#ifndef min
36#define min(x, y) ((x) < (y) ? (x) : (y))
37#endif
38
39#ifndef max
40#define max(x, y) ((x) > (y) ? (x) : (y))
41#endif
42
43
44
45#ifndef strcmpi
46#define strcmpi(x, y) strcasecmp(x, y)
47#endif
48
49#ifdef DC
50#undef stderr
51#undef stdout
52#undef getchar
53/* kos compat */
54#define stderr ((FILE*)2)
55#define stdout ((FILE*)2)
56#define Z_AvailHeap() ((10 * 1024) * 1024)
57#else
58// 64 megs should be enough for anybody. :) --ryan.
59#define Z_AvailHeap() ((64 * 1024) * 1024)
60#endif
61
62#define printchrasm(x,y,ch) printf("%c", (uint8_t ) (ch & 0xFF))
63
64#ifdef __GNUC__
65#define GCC_PACK1_EXT __attribute__((packed,aligned(1)))
66#endif
67
68
69// FCS: Game.c features calls to mkdir without the proper flags.
70// Giving all access is ugly but it is just game OK !
71//#define mkdir(X) mkdir(X,0777)
72
73#define getch getchar
74
75#endif