FTEQW
Documentation of the FTE engine source tree.
progtype.h
Go to the documentation of this file.
1#ifndef QCLIB_PROGTYPE_H
2#define QCLIB_PROGTYPE_H
3
4#if _MSC_VER >= 1300
5 #define QC_ALIGN(a) __declspec(align(a))
6#elif (__GNUC__ >= 3) || defined(__clang__)
7 #define QC_ALIGN(a) __attribute__((aligned(a)))
8#else
9 #define QC_ALIGN(a) //I hope misaligned accesses are okay...
10#endif
11
12#if 0
13//64bit primitives allows for:
14// greater precision timers (so maps can last longer without getting restarted)
15// planet-sized maps (with the engine's vec_t types changed too, and with some sort of magic for the gpu's precision).
16//TODO: for this to work, someone'll have to go through the code to somehow deal with the vec_t/pvec_t/float differences.
17#warning FTE isnt ready for this.
18#include <stdint.h>
19typedef double pvec_t;
22
23#include <inttypes.h>
24#define pPRId PRId64
25#define pPRIi PRIi64
26#define pPRIu PRIu64
27#define pPRIx PRIx64
28#define QCVM_64
29#else
30//use 32bit types, for sanity.
31typedef float pvec_t;
32typedef int pint_t;
33typedef unsigned int puint_t;
34#ifdef _MSC_VER
35 typedef QC_ALIGN(4) __int64 pint64_t;
36 typedef QC_ALIGN(4) unsigned __int64 puint64_t;
37
38 #define pPRId "d"
39 #define pPRIi "i"
40 #define pPRIu "u"
41 #define pPRIx "x"
42 #define pPRIi64 "I64i"
43 #define pPRIu64 "I64u"
44 #define pPRIx64 "I64x"
45#else
46 #include <inttypes.h>
47 typedef int64_t pint64_t QC_ALIGN(4);
48 typedef uint64_t puint64_t QC_ALIGN(4);
49
50 #define pPRId PRId32
51 #define pPRIi PRIi32
52 #define pPRIu PRIu32
53 #define pPRIx PRIx32
54 #define pPRIi64 PRIi64
55 #define pPRIu64 PRIu64
56 #define pPRIx64 PRIx64
57#endif
58#define QCVM_32
59#endif
60
61typedef QC_ALIGN(4) double pdouble_t; //the qcvm uses vectors and stuff, so any 64bit types are only 4-byte aligned. we don't do atomics so this is fine so long as the compiler handles it for us.
62typedef unsigned int pbool;
63typedef pvec_t pvec3_t[3];
67
69
70#endif /* QCLIB_PROGTYPE_H */
71
unsigned int pbool
Definition: progtype.h:62
uint64_t puint_t
Definition: progtype.h:21
pint_t progsnum_t
Definition: progtype.h:64
int64_t pint_t
Definition: progtype.h:20
puint_t string_t
Definition: progtype.h:66
puint_t func_t
Definition: progtype.h:65
pvec_t pvec3_t[3]
Definition: progtype.h:63
double pvec_t
Definition: progtype.h:19
int64_t pint64_t QC_ALIGN(4)
Definition: progtype.h:47
pvec3_t pvec3_origin
double(VARGS *p_ov_time_total)(OggVorbis_File *vf
signed __int64 int64_t
Definition: vk_platform.h:81
unsigned __int64 uint64_t
Definition: vk_platform.h:82