nlib
Config_clang.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_CLANG_H_
17
#define INCLUDE_NN_NLIB_CONFIG_CLANG_H_
18
#ifndef INCLUDE_NN_NLIB_CONFIG_H_
19
#error do not include directly
20
#endif
21
22
#if defined(__clang__)
23
#if !defined(__NX__) && ((__clang_major__ == 3 && __clang_minor__ < 4) || __clang_major__ < 3)
24
#error use clang 3.4 or later
25
#endif
26
27
#if __cplusplus < 201103L
28
#error Use C++11 or later
29
#endif
30
31
#define NLIB_CXX11_SWAPHEADER
32
33
#define NLIB_CXX11_UNIQUEPTR
34
#define NLIB_CXX11_EXTERN_TEMPLATES
35
#define NLIB_CXX11_DEFAULT_TEMPLATE_ARGUMENT_FOR_FUNCTION_TEMPLATES
36
37
#if __has_feature(cxx_exceptions)
38
#ifndef __cpp_exceptions
39
#define __cpp_exceptions 199711L
40
#endif
41
#endif
42
43
#if __has_feature(cxx_lambdas)
44
#ifndef __cpp_lambdas
45
#define __cpp_lambdas 200907L // N2927
46
#endif
47
#endif
48
49
#if __has_feature(cxx_rvalue_references)
50
#ifndef __cpp_rvalue_references
51
#define __cpp_rvalue_references 200610L // N2118
52
#endif
53
#endif
54
55
#if __has_feature(cxx_alias_templates)
56
#ifndef __cpp_alias_templates
57
#define __cpp_alias_templates 200704L // N2258
58
#endif
59
#endif
60
61
#if __has_feature(cxx_deleted_functions) && __has_feature(cxx_defaulted_functions)
62
#define NLIB_CXX11_DEFAULTED_AND_DELETED_FUNCTIONS
63
#endif
64
65
#if __has_feature(cxx_explicit_conversions)
66
#define NLIB_CXX11_EXPLICIT_CONVERSION_OPERATORS
67
#endif
68
69
#if __has_feature(cxx_nullptr)
70
#define NLIB_CXX11_NULL_POINTER_CONSTANT
71
#endif
72
73
#if __has_feature(cxx_static_assert)
74
#ifndef __cpp_static_assert
75
#define __cpp_static_assert 200410L // N1720
76
#endif
77
#endif
78
79
#if __has_feature(cxx_range_for)
80
#ifndef __cpp_range_based_for
81
#define __cpp_range_based_for 200907L // N2930
82
#endif
83
#endif
84
85
#if __has_feature(cxx_override_control)
86
#define NLIB_CXX11_EXPLICIT_VIRTUAL_OVERRIDES
87
#endif
88
89
#if __has_feature(cxx_relaxed_constexpr)
90
#ifndef __cpp_constexpr
91
#define __cpp_constexpr 201304L // N3652
92
#endif
93
#elif __has_feature(cxx_constexpr)
94
#ifndef __cpp_constexpr
95
#define __cpp_constexpr 200704L // N2235
96
#endif
97
#endif
98
99
#if __has_feature(cxx_alignas)
100
#define NLIB_CXX11_ALIGNMENT_SUPPORT
101
#endif
102
103
#if __has_feature(cxx_variadic_templates)
104
#ifndef __cpp_variadic_templates
105
#define __cpp_variadic_templates 200704L // N2242
106
#endif
107
#endif
108
109
#if __has_feature(cxx_delegating_constructors)
110
#ifndef __cpp_delegating_constructors
111
#define __cpp_delegating_constructors 200604L // N1986
112
#endif
113
#endif
114
115
#if __has_include(<chrono>)
116
#define NLIB_CXX11_STDLIB_CHRONO
117
#endif
118
119
#if __has_include(<atomic>)
120
#define NLIB_CXX11_STDLIB_ATOMIC
121
#endif
122
123
#if __has_include(<random>)
124
#define NLIB_CXX11_STDLIB_RANDOM
125
#endif
126
127
#if __has_include(<array>)
128
#define NLIB_CXX11_STDLIB_ARRAY
129
#endif
130
131
#if __has_include(<unordered_set>) && __has_include(<unordered_map>)
132
#define NLIB_CXX11_STDLIB_UNORDERED
133
#endif
134
135
#if __has_include(<tuple>)
136
#define NLIB_CXX11_STDLIB_TUPLE
137
#endif
138
139
#if __has_feature(cxx_generalized_initializers)
140
#ifndef __cpp_initializer_lists
141
#define __cpp_initializer_lists 200806L // N2672
142
#endif
143
#endif
144
#if __has_feature(cxx_nonstatic_member_init)
145
#ifndef __cpp_nsdmi
146
#define __cpp_nsdmi 200809L // N2756
147
#endif
148
#endif
149
#if __has_feature(cxx_inheriting_constructors)
150
#ifndef __cpp_inheriting_constructors
151
#define __cpp_inheriting_constructors 200802L // N2540
152
#endif
153
#endif
154
#if __has_feature(cxx_reference_qualified_functions)
155
#ifndef __cpp_ref_qualifiers
156
#define __cpp_ref_qualifiers 200710L // N2439
157
#endif
158
#endif
159
#if __cplusplus > 201103L && __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 7)
160
// roughly correct(it is complex because clang may use libstdc++)
161
// __cpp_sized_deallocation defined if -fsized-deallocation specified
162
#ifndef __cpp_lib_is_null_pointer
163
#define __cpp_lib_is_null_pointer 201309L // LWG2247
164
#endif
165
#ifndef __cpp_lib_complex_udls
166
#define __cpp_lib_complex_udls 201309L // N3779
167
#endif
168
#ifndef __cpp_lib_tuple_element_t
169
#define __cpp_lib_tuple_element_t 201402L // N3887
170
#endif
171
#ifndef __cpp_lib_make_unique
172
#define __cpp_lib_make_unique 201304L // N3656
173
#endif
174
#ifndef __cpp_lib_shared_timed_mutex
175
#define __cpp_lib_shared_timed_mutex 201402L // N3891
176
#endif
177
#ifndef __cpp_lib_integer_sequence
178
#define __cpp_lib_integer_sequence 201304L // N3658
179
#endif
180
#ifndef __cpp_lib_exchange_function
181
#define __cpp_lib_exchange_function 201304L // N3668
182
#endif
183
#ifndef __cpp_lib_tuples_by_type
184
#define __cpp_lib_tuples_by_type 201304L // N3670
185
#endif
186
#ifndef __cpp_lib_integral_constant_callable
187
#define __cpp_lib_integral_constant_callable 201304L // N3545
188
#endif
189
#ifndef __cpp_lib_transparent_operators
190
#define __cpp_lib_transparent_operators 201210L // N3421
191
#endif
192
#ifndef __cpp_lib_transformation_trait_aliases
193
#define __cpp_lib_transformation_trait_aliases 201304L // N3655
194
#endif
195
#ifndef __cpp_lib_result_of_sfinae
196
#define __cpp_lib_result_of_sfinae 201210L // N3642
197
#endif
198
#ifndef __cpp_lib_is_final
199
#define __cpp_lib_is_final 201402L // LWG2112
200
#endif
201
#ifndef __cpp_lib_chrono_udls
202
#define __cpp_lib_chrono_udls 201304L // N3642
203
#endif
204
#ifndef __cpp_lib_string_udls
205
#define __cpp_lib_string_udls 201304L // N3642
206
#endif
207
#ifndef __cpp_lib_generic_associative_lookup
208
#define __cpp_lib_generic_associative_lookup 201304L // N3657
209
#endif
210
#ifndef __cpp_lib_null_iterators
211
#define __cpp_lib_null_iterators 201304L // N3644
212
#endif
213
#ifndef __cpp_lib_make_reverse_iterator
214
#define __cpp_lib_make_reverse_iterator 201402L // LWG2285
215
#endif
216
#ifndef __cpp_lib_robust_nonmodifying_seq_ops
217
#define __cpp_lib_robust_nonmodifying_seq_ops 201304L // N3671
218
#endif
219
#ifndef __cpp_lib_quoted_string_io
220
#define __cpp_lib_quoted_string_io 201304L // N3654
221
#endif
222
#endif
223
224
#include <cassert>
225
#ifndef NLIB_ASSERT
226
#define NLIB_ASSERT assert
227
#endif
228
229
#define NLIB_ALIGNAS(x) __attribute__((aligned(x)))
230
#define NLIB_ALIGNOF(tp) __alignof__(tp)
231
232
#define NLIB_HAS_NATIVE_TYPETRAITS
233
234
#endif
235
#endif // INCLUDE_NN_NLIB_CONFIG_CLANG_H_
© Nintendo Co., Ltd. All rights reserved.