blob: 1e98b0acacd111df3402149281d4ee5d3df73cb7 (
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
|
/**
* @file base_types.h
*
* Defines some base types, includes config.h
*
* @author Ben Gardner
* @license GPL v2+
*/
#ifndef BASE_TYPES_H_INCLUDED
#define BASE_TYPES_H_INCLUDED
#include "error_types.h"
#ifdef WIN32
#include "windows_compat.h"
#else // not WIN32
#include "config.h"
#define PATH_SEP '/'
#define __STDC_FORMAT_MACROS
#if defined HAVE_INTTYPES_H
#include <inttypes.h>
#else
#error "Don't know where int8_t is defined"
#endif
// some of my favorite aliases
typedef char CHAR;
typedef int8_t INT8;
typedef int16_t INT16;
typedef int32_t INT32;
typedef uint8_t UINT8;
typedef uint16_t UINT16;
typedef uint32_t UINT32;
typedef uint64_t UINT64;
#endif /* ifdef WIN32 */
// and the ever-so-important array size macro
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
#endif
#endif /* BASE_TYPES_H_INCLUDED */
|