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