summaryrefslogtreecommitdiff
path: root/include/al/types.h
blob: 2e2ebfea3d42c325e4f5af9135dfb01f5053aff3 (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
#ifndef _AL_TYPES_H
#define _AL_TYPES_H

// https://www.gnu.org/software/c-intro-and-ref/manual/html_node/Integer-Const-Type.html

#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

#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#include <basetsd.h>
typedef SSIZE_T ssize_t;
#endif

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

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

typedef float f32;
typedef double f64;

// long can be a distinctly different size based on the toolchain we are using.
// Use long and ulong, if needed, for API compatibility.
typedef unsigned long ulong;
typedef unsigned char uchar;

#endif // _AL_TYPES_H