Iros
 
Loading...
Searching...
No Matches
config.h
Go to the documentation of this file.
1#pragma once
2
3#ifdef __cplusplus
4#define __CCPP_BEGIN_DECLARATIONS extern "C" {
5#define __CCPP_END_DECLARATIONS }
6#else
7#define __CCPP_BEGIN_DECLARATIONS
8#define __CCPP_END_DECLARATIONS
9#endif
10
11#if !defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) && !defined(__STRICT_ANSI__)
12#define _GNU_SOURCE 1
13#endif
14
15#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
16#define __CCPP_COMPAT 1
17#endif
18
19#if defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) || defined(__CCPP_COMPAT)
20#define __CCPP_POSIX_EXTENSIONS 1
21#endif
22
23#define __CCPP_C23_DEPRECATED
24
25#ifdef __cplusplus
26#if (__cplusplus >= 201703L)
27#define __CCPP_C11
28#endif
29#if (__cplusplus >= 201402L)
30#define __CCPP_C99
31#endif
32#define __CCPP_C89
33#elif defined(__STDC__)
34#ifdef __STDC_VERSION__
35#if (__STDC_VERSION__ >= 201710L)
36#define __CCPP_C17
37#endif
38#if (__STDC_VERSION__ >= 201112L)
39#define __CCPP_C11
40#endif
41#if (__STDC_VERSION__ >= 199901L)
42#define __CCPP_C99
43#endif
44#if (__STDC_VERSION__ >= 199409L)
45#define __CCPP_C95
46#endif
47#define __CCPP_C89
48#endif
49#endif
50
51#if !defined(__cplusplus) && defined(__CCPP_C11)
52#define __CCPP_NORETURN _Noreturn
53#else
54#define __CCPP_NORETURN __attribute__((__noreturn__))
55#endif
56
57#if !defined(__cplusplus) && defined(__CCPP_C99)
58#define __CCPP_RESTRICT restrict
59#elif defined(__GNUC__) || defined(__clang__)
60#define __CCPP_RESTRICT __restrict
61#else
62#define __CCPP_RESTRICT
63#endif
64
65#ifdef __x86_64__
66#define __CCPP_ARCH x86_64
67#define __CCPP_ARCH_X86_64
68#else
69#error "Unsupported ccpp architecture"
70#endif
71
72#ifdef __iros__
73#define __CCPP_PLATFORM iros
74#define __CCPP_PLATFORM iros
75#define __CCPP_PLATFORM_IROS 1
76#elif defined(__linux__)
77#undef __GLIBC__
78#undef linux
79#define __CCPP_PLATFORM linux
80#define __CCPP_PLATFORM_LINUX 1
81#else
82#error "Unsupported ccpp platform"
83#endif
84
85#define __CCPP_ARCH_PATH(path) <ccpp/bits/arch/__CCPP_ARCH/path>
86#define __CCPP_PLATFORM_PATH(path) <ccpp/bits/__CCPP_PLATFORM/path>
87#define __CCPP_ARCH_PLATFORM_PATH(path) <ccpp/bits/arch/__CCPP_ARCH/__CCPP_PLATFORM/path>