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__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 8) || \
25  (__GNUC__ == 4 && __GNUC_MINOR__ == 8 && __GNUC_PATCHLEVEL__ < 2)
26 # error Use gcc 4.8.2 or later
27 #endif
28 
29 #if defined(__EXCEPTIONS) && !defined(__cpp_exceptions)
30 #define __cpp_exceptions 199711L
31 #endif
32 
33 #ifdef __cpp_exceptions
34 # define NLIB_EXCEPTION_ENABLED
35 #endif
36 
37 #if __cplusplus >= 201103L
38 #define NLIB_CXX11_STATIC_ASSERTIONS
39 #ifndef __cpp_static_assert
40 #define __cpp_static_assert 200410L // N1720
41 #endif
42 
43 #define NLIB_CXX11_NULL_POINTER_CONSTANT
44 #define NLIB_CXX11_RVALUE_REFERENCES
45 #ifndef __cpp_rvalue_references
46 #define __cpp_rvalue_references 200610L // N2118
47 #endif
48 
49 #define NLIB_CXX11_LAMBDAS
50 #ifndef __cpp_lambdas
51 #define __cpp_lambdas 200907L // N2927
52 #endif
53 
54 #define NLIB_CXX11_RANGE_BASED_FOR
55 #ifndef __cpp_range_based_for
56 #define __cpp_range_based_for 200907L // N2930
57 #endif
58 
59 #define NLIB_CXX11_TEMPLATE_ALIAS
60 #ifndef __cpp_alias_templates
61 #define __cpp_alias_templates 200704L // N2258
62 #endif
63 
64 #define NLIB_CXX11_VARIADIC_TEMPLATES
65 #ifndef __cpp_variadic_templates
66 #define __cpp_variadic_templates 200704L // N2242
67 #endif
68 
69 #define NLIB_CXX11_DELEGATING_CONSTRUCTORS
70 #ifndef __cpp_delegating_constructors
71 #define __cpp_delegating_constructors 200604L // N1986
72 #endif
73 
74 #define NLIB_CXX11_CONSTEXPR
75 #ifndef __cpp_constexpr
76 #define __cpp_constexpr 200704 // N2235
77 #endif
78 
79 #define NLIB_CXX11_EXTERN_TEMPLATES
80 #define NLIB_CXX11_DEFAULTED_AND_DELETED_FUNCTIONS
81 #define NLIB_CXX11_EXPLICIT_CONVERSION_OPERATORS
82 #define NLIB_CXX11_EXPLICIT_VIRTUAL_OVERRIDES
83 #define NLIB_CXX11_ALIGNMENT_SUPPORT
84 #define NLIB_CXX11_DEFAULT_TEMPLATE_ARGUMENT_FOR_FUNCTION_TEMPLATES
85 #define NLIB_CXX11_ALIGNMENT_SUPPORT
86 #endif
87 
88 #if defined(__cpp_constexpr) && __cpp_constexpr >= 201304L
89 #define NLIB_CXX14_CONSTEXPR
90 #endif
91 
92 // #include <bits/c++config.h>
93 // #ifndef __GLIBCXX__
94 // # error c++config.h should define __GLIBCXX__ ...
95 // #endif
96 
97 #define NLIB_CXX11_UNIQUEPTR
98 #define NLIB_CXX11_STDLIB_ARRAY
99 #define NLIB_CXX11_STDLIB_UNORDERED
100 #define NLIB_CXX11_STDLIB_TUPLE
101 #define NLIB_HAS_NATIVE_TYPETRAITS
102 #define NLIB_CXX11_STDLIB_RANDOM
103 #define NLIB_CXX11_STDLIB_CHRONO
104 #define NLIB_CXX11_STDLIB_ATOMIC
105 
106 #if __cplusplus >= 201103L
107 #ifndef __cpp_raw_strings
108 #define __cpp_raw_strings 200710L // N2442
109 #endif
110 #ifndef __cpp_unicode_literals
111 #define __cpp_unicode_literals 200710L // N2442
112 #endif
113 #ifndef __cpp_user_defined_literals
114 #define __cpp_user_defined_literals 200809L // N2765
115 #endif
116 #ifndef __cpp_decltype
117 #define __cpp_decltype 200707L // N2343
118 #endif
119 #ifndef __cpp_attributes
120 #define __cpp_attributes 200809L // N2761
121 #endif
122 #ifndef __cpp_initializer_lists
123 #define __cpp_initializer_lists 200806L // N2672
124 #endif
125 #ifndef __cpp_nsdmi
126 #define __cpp_nsdmi 200809L // N2756
127 #endif
128 #ifndef __cpp_inheriting_constructors
129 #define __cpp_inheriting_constructors 200802L // N2540
130 #endif
131 #ifndef __cpp_ref_qualifiers
132 #define __cpp_ref_qualifiers 200710L // N2439
133 #endif
134 #ifndef __cpp_decltype_auto
135 #define __cpp_decltype_auto 201304L // N3638
136 #endif
137 #ifndef __cpp_lib_complex_udls
138 #define __cpp_lib_complex_udls 201309L // N3779
139 #endif
140 #ifndef __cpp_lib_tuple_element_t
141 #define __cpp_lib_tuple_element_t 201402L // N3887
142 #endif
143 
144 #if __cplusplus > 201103L && \
145  (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9))
146 #ifndef __cpp_binary_literals
147 #define __cpp_binary_literals 201304L // N3472
148 #endif
149 #ifndef __cpp_init_captures
150 #define __cpp_init_captures 201304L // N3648
151 #endif
152 #ifndef __cpp_generic_lambdas
153 #define __cpp_generic_lambdas 201304L // N3649
154 #endif
155 #ifndef __cpp_return_type_deduction
156 #define __cpp_return_type_deduction 201304L // N3638
157 #endif
158 #ifndef __cpp_lib_shared_timed_mutex
159 #define __cpp_lib_shared_timed_mutex 201402L // N3891
160 #endif
161 #ifndef __cpp_lib_is_null_pointer
162 #define __cpp_lib_is_null_pointer 201309L // LWG2247
163 #endif
164 #endif
165 
166 #if __cplusplus > 201103L && __GNUC__ >= 5
167 #ifndef __cpp_lib_generic_associative_lookup
168 #define __cpp_lib_generic_associative_lookup 201304L // N3657
169 #endif
170 #ifndef __cpp_lib_null_iterators
171 #define __cpp_lib_null_iterators 201304L // N3644
172 #endif
173 #endif
174 #endif
175 
176 #include <cassert> // NOLINT
177 #define NLIB_ASSERT assert
178 
179 #define NLIB_ALIGNAS(x) __attribute__((aligned(x)))
180 #define NLIB_ALIGNOF(tp) __alignof__(tp)
181 
182 #endif
183 #endif // INCLUDE_NN_NLIB_CONFIG_GCC_H_