Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
stenzek
GitHub Repository: stenzek/duckstation
Path: blob/master/dep/rapidyaml/include/c4/platform.hpp
4261 views
1
#ifndef _C4_PLATFORM_HPP_
2
#define _C4_PLATFORM_HPP_
3
4
/** @file platform.hpp Provides platform information macros
5
* @ingroup basic_headers */
6
7
// see also https://sourceforge.net/p/predef/wiki/OperatingSystems/
8
9
#if defined(_WIN64)
10
# define C4_WIN
11
# define C4_WIN64
12
#elif defined(_WIN32)
13
# define C4_WIN
14
# define C4_WIN32
15
#elif defined(__ANDROID__)
16
# define C4_ANDROID
17
#elif defined(__APPLE__)
18
# include "TargetConditionals.h"
19
# if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
20
# define C4_IOS
21
# elif TARGET_OS_MAC || TARGET_OS_OSX
22
# define C4_MACOS
23
# else
24
# error "Unknown Apple platform"
25
# endif
26
#elif defined(__linux__) || defined(__linux)
27
# define C4_UNIX
28
# define C4_LINUX
29
#elif defined(__unix__) || defined(__unix)
30
# define C4_UNIX
31
#elif defined(__arm__) || defined(__aarch64__)
32
# define C4_ARM
33
#elif defined(__xtensa__) || defined(__XTENSA__)
34
# define C4_XTENSA
35
#elif defined(SWIG)
36
# define C4_SWIG
37
#else
38
# error "unknown platform"
39
#endif
40
41
#if defined(__posix) || defined(C4_UNIX) || defined(C4_LINUX)
42
# define C4_POSIX
43
#endif
44
45
46
#endif /* _C4_PLATFORM_HPP_ */
47
48