]> git.xonotic.org Git - xonotic/darkplaces.git/blob - qtypes.h
Rename qboolean to qbool
[xonotic/darkplaces.git] / qtypes.h
1
2 #ifndef QTYPES_H
3 #define QTYPES_H
4
5 #include <stdint.h>
6 #include <stdbool.h>
7 #include <inttypes.h>
8
9 typedef bool qbool;
10
11 #ifndef NULL
12 #define NULL ((void *)0)
13 #endif
14
15 // up / down
16 #define PITCH   0
17
18 // left / right
19 #define YAW             1
20
21 // fall over
22 #define ROLL    2
23
24 #if defined(__GNUC__) || (__clang__) || (__TINYC__) || (_MSC_VER >= 1400)
25 #define RESTRICT __restrict
26 #else
27 #define RESTRICT
28 #endif
29
30 // LadyHavoc: upgrade the prvm to double precision for better time values
31 // LadyHavoc: to be enabled when bugs are worked out...
32 //#define PRVM_64
33 #ifdef PRVM_64
34 typedef double prvm_vec_t;
35 typedef int64_t prvm_int_t;
36 typedef uint64_t prvm_uint_t;
37 #define PRVM_PRIi PRIi64
38 #define PRVM_PRIu PRIu64
39 #else
40 typedef float prvm_vec_t;
41 typedef int32_t prvm_int_t;
42 typedef uint32_t prvm_uint_t;
43 #define PRVM_PRIi PRIi32
44 #define PRVM_PRIu PRIu32
45 #endif
46 typedef prvm_vec_t prvm_vec3_t[3];
47
48 #ifdef VEC_64
49 typedef double vec_t;
50 #else
51 typedef float vec_t;
52 #endif
53 typedef vec_t vec2_t[2];
54 typedef vec_t vec3_t[3];
55 typedef vec_t vec4_t[4];
56 typedef vec_t vec5_t[5];
57 typedef vec_t vec6_t[6];
58 typedef vec_t vec7_t[7];
59 typedef vec_t vec8_t[8];
60
61 #endif