build system revision
[vg.git] / vg_platform.h
1 #pragma once
2
3 #if 0
4 #include "vg_stdint.h"
5 // Resource types
6 typedef struct vg_tex2d vg_tex2d;
7
8 struct vg_achievement
9 {
10 int is_set;
11 const char *name;
12 };
13
14 #define vg_static_assert _Static_assert
15 #define VG_MUST_USE_RESULT __attribute__((warn_unused_result))
16
17
18 #include <stdio.h>
19 #include <string.h>
20 #include <stdarg.h>
21 #include <ctype.h>
22 #include <math.h>
23 #include <assert.h>
24 #include <setjmp.h>
25 #include <sys/time.h>
26 #include <math.h>
27 #include <stdio.h>
28 #include <errno.h>
29 #include <stdlib.h>
30 #endif
31
32 #include <stdlib.h>
33 #include <stdint.h>
34
35 typedef uint8_t u8;
36 typedef uint16_t u16;
37 typedef uint32_t u32;
38 typedef uint64_t u64;
39 typedef int8_t i8;
40 typedef int16_t i16;
41 typedef int32_t i32;
42 typedef int64_t i64;
43 typedef float f32;
44 typedef double f64;
45 typedef uint8_t bool;
46
47 typedef unsigned int uint;
48 typedef int v2i[2];
49 typedef int v3i[3];
50 typedef int v4i[4];
51 typedef float v2f[2];
52 typedef float v3f[3];
53 typedef float v4f[4];
54 typedef v2f m2x2f[2];
55 typedef v3f m3x3f[3];
56 typedef v3f m4x3f[4];
57 typedef v4f m4x4f[4];
58 typedef v3f boxf[2];
59
60 /* anything compiled against VG shall implement this function somewhere. */
61 void vg_fatal_error( const char *fmt, ... );
62
63 #define VG_MIN( A, B ) ((A)<(B)?(A):(B))
64 #define VG_MAX( A, B ) ((A)>(B)?(A):(B))
65 #define vg_list_size( A ) (sizeof(A)/sizeof(A[0]))