]> de.git.xonotic.org Git - xonotic/darkplaces.git/blob - qtypes.h
Resolved .gitignore conflict
[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 typedef int8_t i8;
31 typedef int16_t i16;
32 typedef int32_t i32;
33 typedef int64_t i64;
34
35 typedef uint8_t u8;
36 typedef uint16_t u16;
37 typedef uint32_t u32;
38 typedef uint64_t u64;
39
40 typedef intptr_t iptr;
41 typedef uintptr_t uptr;
42
43 // LadyHavoc: upgrade the prvm to double precision for better time values
44 // LadyHavoc: to be enabled when bugs are worked out...
45 //#define PRVM_64
46 #ifdef PRVM_64
47 typedef double prvm_vec_t;
48 typedef int64_t prvm_int_t;
49 typedef uint64_t prvm_uint_t;
50 #define PRVM_PRIi PRIi64
51 #define PRVM_PRIu PRIu64
52 #else
53 typedef float prvm_vec_t;
54 typedef int32_t prvm_int_t;
55 typedef uint32_t prvm_uint_t;
56 #define PRVM_PRIi PRIi32
57 #define PRVM_PRIu PRIu32
58 #endif
59 typedef prvm_vec_t prvm_vec3_t[3];
60
61 #ifdef VEC_64
62 typedef double vec_t;
63 #else
64 typedef float vec_t;
65 #endif
66 typedef vec_t vec2_t[2];
67 typedef vec_t vec3_t[3];
68 typedef vec_t vec4_t[4];
69 #endif