nlib
Config_gcc.h
1 
2 /*--------------------------------------------------------------------------------*
3  Project: CrossRoad
4  Copyright (C)Nintendo All rights reserved.
5 
6  These coded instructions, statements, and computer programs contain proprietary
7  information of Nintendo and/or its licensed developers and are protected by
8  national and international copyright laws. They may not be disclosed to third
9  parties or copied or duplicated in any form, in whole or in part, without the
10  prior written consent of Nintendo.
11 
12  The content herein is highly confidential and should be handled accordingly.
13  *--------------------------------------------------------------------------------*/
14 
15 #pragma once
16 #ifndef INCLUDE_NN_NLIB_CONFIG_GCC_H_
17 #define INCLUDE_NN_NLIB_CONFIG_GCC_H_
18 #ifndef INCLUDE_NN_NLIB_CONFIG_H_
19 #error do not include directly
20 #endif
21 
22 #if defined(__GNUC__)
23 
24 #if __GNUC__ < 5
25 #error Use gcc 5.x or above
26 #endif
27 
28 #if __cplusplus < 201103L
29 #error Use C++11 or later
30 #endif
31 
32 #if defined(__EXCEPTIONS) && !defined(__cpp_exceptions)
33 #define __cpp_exceptions 199711L
34 #endif
35 
36 #if __cplusplus >= 201103L
37 #ifndef __cpp_static_assert
38 #define __cpp_static_assert 200410L // N1720
39 #endif
40 
41 #define NLIB_CXX11_NULL_POINTER_CONSTANT
42 #ifndef __cpp_rvalue_references
43 #define __cpp_rvalue_references 200610L // N2118
44 #endif
45 
46 #ifndef __cpp_lambdas
47 #define __cpp_lambdas 200907L // N2927
48 #endif
49 
50 #ifndef __cpp_range_based_for
51 #define __cpp_range_based_for 200907L // N2930
52 #endif
53 
54 #ifndef __cpp_alias_templates
55 #define __cpp_alias_templates 200704L // N2258
56 #endif
57 
58 #ifndef __cpp_variadic_templates
59 #define __cpp_variadic_templates 200704L // N2242
60 #endif
61 
62 #ifndef __cpp_delegating_constructors
63 #define __cpp_delegating_constructors 200604L // N1986
64 #endif
65 
66 #ifndef __cpp_constexpr
67 #define __cpp_constexpr 200704 // N2235
68 #endif
69 
70 #define NLIB_CXX11_EXTERN_TEMPLATES
71 #define NLIB_CXX11_DEFAULTED_AND_DELETED_FUNCTIONS
72 #define NLIB_CXX11_EXPLICIT_CONVERSION_OPERATORS
73 #define NLIB_CXX11_EXPLICIT_VIRTUAL_OVERRIDES
74 #define NLIB_CXX11_ALIGNMENT_SUPPORT
75 #define NLIB_CXX11_DEFAULT_TEMPLATE_ARGUMENT_FOR_FUNCTION_TEMPLATES
76 #define NLIB_CXX11_ALIGNMENT_SUPPORT
77 #endif
78 
79 // #include <bits/c++config.h>
80 // #ifndef __GLIBCXX__
81 // # error c++config.h should define __GLIBCXX__ ...
82 // #endif
83 
84 #define NLIB_CXX11_UNIQUEPTR
85 #define NLIB_CXX11_STDLIB_ARRAY
86 #define NLIB_CXX11_STDLIB_UNORDERED
87 #define NLIB_CXX11_STDLIB_TUPLE
88 #define NLIB_HAS_NATIVE_TYPETRAITS
89 #define NLIB_CXX11_STDLIB_RANDOM
90 #define NLIB_CXX11_STDLIB_CHRONO
91 #define NLIB_CXX11_STDLIB_ATOMIC
92 
93 #ifndef __cpp_raw_strings
94 #define __cpp_raw_strings 200710L // N2442
95 #endif
96 #ifndef __cpp_unicode_literals
97 #define __cpp_unicode_literals 200710L // N2442
98 #endif
99 #ifndef __cpp_user_defined_literals
100 #define __cpp_user_defined_literals 200809L // N2765
101 #endif
102 #ifndef __cpp_decltype
103 #define __cpp_decltype 200707L // N2343
104 #endif
105 #ifndef __cpp_attributes
106 #define __cpp_attributes 200809L // N2761
107 #endif
108 #ifndef __cpp_initializer_lists
109 #define __cpp_initializer_lists 200806L // N2672
110 #endif
111 #ifndef __cpp_nsdmi
112 #define __cpp_nsdmi 200809L // N2756
113 #endif
114 #ifndef __cpp_inheriting_constructors
115 #define __cpp_inheriting_constructors 200802L // N2540
116 #endif
117 #ifndef __cpp_ref_qualifiers
118 #define __cpp_ref_qualifiers 200710L // N2439
119 #endif
120 #ifndef __cpp_decltype_auto
121 #define __cpp_decltype_auto 201304L // N3638
122 #endif
123 #ifndef __cpp_lib_complex_udls
124 #define __cpp_lib_complex_udls 201309L // N3779
125 #endif
126 #ifndef __cpp_lib_tuple_element_t
127 #define __cpp_lib_tuple_element_t 201402L // N3887
128 #endif
129 
130 #if __cplusplus > 201103L
131 #ifndef __cpp_binary_literals
132 #define __cpp_binary_literals 201304L // N3472
133 #endif
134 #ifndef __cpp_init_captures
135 #define __cpp_init_captures 201304L // N3648
136 #endif
137 #ifndef __cpp_generic_lambdas
138 #define __cpp_generic_lambdas 201304L // N3649
139 #endif
140 #ifndef __cpp_return_type_deduction
141 #define __cpp_return_type_deduction 201304L // N3638
142 #endif
143 #ifndef __cpp_lib_shared_timed_mutex
144 #define __cpp_lib_shared_timed_mutex 201402L // N3891
145 #endif
146 #ifndef __cpp_lib_is_null_pointer
147 #define __cpp_lib_is_null_pointer 201309L // LWG2247
148 #endif
149 #ifndef __cpp_lib_generic_associative_lookup
150 #define __cpp_lib_generic_associative_lookup 201304L // N3657
151 #endif
152 #ifndef __cpp_lib_null_iterators
153 #define __cpp_lib_null_iterators 201304L // N3644
154 #endif
155 #endif
156 
157 #include <cassert>
158 #define NLIB_ASSERT assert
159 
160 #define NLIB_ALIGNAS(x) __attribute__((aligned(x)))
161 #define NLIB_ALIGNOF(tp) __alignof__(tp)
162 
163 #endif
164 #endif // INCLUDE_NN_NLIB_CONFIG_GCC_H_