GoldFish Engine
Quite simple and lightweight game engine
Loading...
Searching...
No Matches
compat.h
Go to the documentation of this file.
1
7#ifndef __GF_TYPE_COMPAT_H__
8#define __GF_TYPE_COMPAT_H__
9
10#ifdef __STDC_VERSION__
11#if __STDC_VERSION__ >= 199901L
12#define GF_IS_C99
13#endif
14#endif
15
16#ifdef GF_IS_C99
17#include <stdbool.h>
18#include <stdint.h>
19
20#define gf_true true
21#define gf_false false
22typedef bool gf_bool_t;
23
24typedef uint8_t gf_uint8_t;
25typedef uint16_t gf_uint16_t;
26typedef uint32_t gf_uint32_t;
27typedef uint64_t gf_uint64_t;
28
29typedef int8_t gf_int8_t;
30typedef int16_t gf_int16_t;
31typedef int32_t gf_int32_t;
32typedef int64_t gf_int64_t;
33#else
34#define gf_true 1
35#define gf_false (!gf_true)
36typedef unsigned char gf_bool_t;
37
38typedef unsigned char gf_uint8_t;
39typedef unsigned short gf_uint16_t;
40typedef unsigned int gf_uint32_t;
41typedef gf_uint32_t gf_uint64_t;
42
43typedef signed char gf_int8_t;
44typedef signed short gf_int16_t;
45typedef signed int gf_int32_t;
46typedef gf_int32_t gf_int64_t;
47#endif
48
49#endif