summaryrefslogtreecommitdiff
path: root/include/al/types.h
blob: c164127d65a80da6755eba37affd3d349395b7f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef _AL_TYPES_H
#define _AL_TYPES_H

#ifdef _POSIX_C_SOURCE
#if _POSIX_C_SOURCE < 200112L
#error "libalabaster requires _POSIX_C_SOURCE >= 200112L"
#endif
#else
#define _POSIX_C_SOURCE 200112L
#endif

#ifdef _XOPEN_SOURCE
#if _XOPEN_SOURCE < 500
#error "libalabaster requires _XOPEN_SOURCE >= 500"
#endif
#else
#define _XOPEN_SOURCE 500
#endif

#if _WIN32 || _WIN64
#if _WIN64
#define PTR_IS_64
#else
#define PTR_IS_32
#endif
#elif __GNUC__
#if __x86_64__ || __ppc64__
#define PTR_IS_64
#else
#define PTR_IS_32
#endif
#elif UINTPTR_MAX > UINT_MAX
#define PTR_IS_64
#else
#define PTR_IS_32
#endif

#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include <sys/types.h>
#include <float.h>

typedef uint8_t  u8;
typedef int8_t   s8;
typedef uint16_t u16;
typedef int16_t  s16;
typedef uint32_t u32;
typedef int32_t  s32;
typedef uint64_t u64;
typedef int64_t  s64;

typedef float  f32;
typedef double f64;

#ifdef _MSC_VER
#include <BaseTsd.h>
typedef SSIZE_T ssize_t;
#endif

#endif // _AL_TYPES_H