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
|
//
// rockbox_compat.h
// Duke3D
//
// Based on unix_compat.h
// Copyright Wed, Jul 31, 2013, Juan Manuel Borges CaƱo (GPLv3+)
//
/* all we need */
#include "SDL.h"
#include "plugin.h"
#ifndef Duke3D_rockbox_compat_h
#define Duke3D_rockbox_compat_h
//#define BYTE_ORDER LITTLE_ENDIAN
#define PLATFORM_SUPPORTS_SDL
#define kmalloc(x) malloc(x)
#define kkmalloc(x) malloc(x)
#define kfree(x) free(x)
#define kkfree(x) free(x)
#ifdef FP_OFF
#undef FP_OFF
#endif
// Horrible horrible macro: Watcom allowed memory pointer to be cast
// to a 32bits integer. The code is unfortunately stuffed with this :( !
#define FP_OFF(x) ((int32_t)(x))
#ifndef max
#define max(x, y) (((x) > (y)) ? (x) : (y))
#endif
#ifndef min
#define min(x, y) (((x) < (y)) ? (x) : (y))
#endif
#include <inttypes.h>
#define __int64 int64_t
#define O_BINARY 0
#define UDP_NETWORKING 1
#define PLATFORM_ROCKBOX 1
#define read(a, b, c) rb->read((a), (b), (c))
#define write(a, b, c) rb->write((a), (b), (c))
#define close(a) rb->close(a)
/*
#define SOL_IP SOL_SOCKET
#define IP_RECVERR SO_BROADCAST
*/
#define stricmp strcasecmp
#define strcmpi strcasecmp
#define S_IREAD S_IRUSR
#define USER_DUMMY_NETWORK 1
#define STUB_NETWORKING 1
#endif
|