blob: 5ae42a229e36d7fb269fcf004c42ebb3345e1293 (
plain) (
blame)
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
#ifndef BASE_INCLUDE_H
#define BASE_INCLUDE_H
#if defined(__APPLE__)
#define PLATFORM_APPLE 1
#elif defined(__linux__)
#define PLATFORM_LINUX 1
#elif defined(_WIN32)
#define PLATFORM_WINDOWS 1
#else
#error Unsupported platform
#endif // platform definitions
#ifndef PLATFORM_APPLE
#define PLATFORM_APPLE 0
#endif
#ifndef PLATFORM_LINUX
#define PLATFORM_LINUX 0
#endif
#ifndef PLATFORM_WINDOWS
#define PLATFORM_WINDOWS 0
#endif
#ifndef DEBUG
#define DEBUG 0
#endif
#if PLATFORM_LINUX
#include <unistd.h>
#include <dirent.h>
#include <sys/mman.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/un.h>
#include <fcntl.h>
#include <dlfcn.h>
#include <signal.h>
#include <link.h>
#include <execinfo.h>
#include <pthread.h>
#elif PLATFORM_WINDOWS
#define _WIN32_WINNT 0x0601
#include <windows.h>
#endif // PLATFORM_LINUX - PLATFORM_WINDOWS
//-
#include <time.h>
#include <string.h>
#include <stdint.h>
#include <stdio.h>
#include <stdarg.h>
#include <errno.h>
#include <math.h>
//-
#include "base_core.h"
#include "base_memory.h"
#include "base_arena.h"
#include "base_stack.h"
#include "base_string.h"
#include "base_thread.h"
#include "base_math.h"
#include "base_profile.h"
#if PLATFORM_LINUX
#include "base_arena_linux.h"
#include "base_stack_linux.h"
#include "base_thread_linux.h"
#include "base_platform_linux.h"
#elif PLATFORM_WINDOWS
#include "base_arena_win32.h"
#include "base_stack_win32.h"
#include "base_platform_win32.h"
#else
#error unsupported platform
#endif
#if ARCH_x86_64
#include "base_profile_x64.h"
#elif ARCH_ARM
#include "base_profile_arm.h"
#endif
#include "base_memory.cpp"
#include "base_arena.cpp"
#include "base_stack.cpp"
#include "base_string.cpp"
#include "base_math.cpp"
#include "base_simd.cpp"
#if PLATFORM_LINUX
#include "base_arena_linux.cpp"
#include "base_stack_linux.cpp"
#include "base_thread_linux.cpp"
#include "base_platform_linux.cpp"
#elif PLATFORM_WINDOWS
#include "base_arena_win32.cpp"
#include "base_stack_win32.cpp"
#include "base_platform_win32.cpp"
#endif
#if ARCH_x86_64
#include "base_profile_x64.cpp"
#elif ARCH_ARM
#include "base_profile_arm.cpp"
#else
#error platform not supported for profiling
#endif
#include "base_rand.cpp"
#endif // BASE_INCLUDE_H
|