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
24
#define NLIB_CXX11_SWAPHEADER
25
26
#if __cplusplus > 199711L
27
# define NLIB_CXX11_UNIQUEPTR
28
# define NLIB_CXX11_EXTERN_TEMPLATES
29
# define NLIB_CXX11_DEFAULT_TEMPLATE_ARGUMENT_FOR_FUNCTION_TEMPLATES
30
#endif
31
32
#if __has_feature(cxx_exceptions)
33
# define NLIB_EXCEPTION_ENABLED
34
#endif
35
36
#if __has_feature(cxx_lambdas)
37
# define NLIB_CXX11_LAMBDAS
38
#endif
39
40
#if __has_feature(cxx_rvalue_references)
41
# define NLIB_CXX11_RVALUE_REFERENCES
42
#endif
43
44
#if __has_feature(cxx_alias_templates)
45
# define NLIB_CXX11_TEMPLATE_ALIAS
46
#endif
47
48
#if __has_feature(cxx_deleted_functions) && __has_feature(cxx_defaulted_functions)
49
# define NLIB_CXX11_DEFAULTED_AND_DELETED_FUNCTIONS
50
#endif
51
52
#if __has_feature(cxx_explicit_conversions)
53
# define NLIB_CXX11_EXPLICIT_CONVERSION_OPERATORS
54
#endif
55
56
#if __has_feature(cxx_nullptr)
57
# define NLIB_CXX11_NULL_POINTER_CONSTANT
58
#endif
59
60
#if __has_feature(cxx_static_assert)
61
# define NLIB_CXX11_STATIC_ASSERTIONS
62
#endif
63
64
#if __has_feature(cxx_range_for)
65
# define NLIB_CXX11_RANGE_BASED_FOR
66
#endif
67
68
#if __has_feature(cxx_override_control)
69
# define NLIB_CXX11_EXPLICIT_VIRTUAL_OVERRIDES
70
#endif
71
72
#if __has_feature(cxx_constexpr)
73
# define NLIB_CXX11_CONSTEXPR
74
#endif
75
76
#if __has_feature(cxx_alignas)
77
# define NLIB_CXX11_ALIGNMENT_SUPPORT
78
#endif
79
80
#if __has_feature(cxx_variadic_templates)
81
# define NLIB_CXX11_VARIADIC_TEMPLATES
82
#endif
83
84
#if __has_feature(cxx_delegating_constructors)
85
# define NLIB_CXX11_DELEGATING_CONSTRUCTORS
86
#endif
87
88
#if __has_include(<chrono>)
89
# define NLIB_CXX11_STDLIB_CHRONO
90
#endif
91
92
#if __has_include(<atomic>)
93
# define NLIB_CXX11_STDLIB_ATOMIC
94
#endif
95
96
#if __has_include(<random>)
97
# define NLIB_CXX11_STDLIB_RANDOM
98
#endif
99
100
#if __has_include(<array>)
101
# define NLIB_CXX11_STDLIB_ARRAY
102
#endif
103
104
#if __has_include(<unordered_set>) && __has_include(<unordered_map>)
105
# define NLIB_CXX11_STDLIB_UNORDERED
106
#endif
107
108
#if __has_include(<tuple>)
109
# define NLIB_CXX11_STDLIB_TUPLE
110
#endif
111
112
#include <cassert>
// NOLINT
113
#ifndef NLIB_ASSERT
114
#define NLIB_ASSERT assert
115
#endif
116
117
#define NLIB_ALIGNAS(x) __attribute__((aligned(x)))
118
#define NLIB_ALIGNOF(tp) __alignof__(tp)
119
120
#define NLIB_HAS_NATIVE_TYPETRAITS
121
122
// libstdc++ workaround, See https://svn.boost.org/trac/boost/ticket/7473
123
#if !__has_include(<ext/cmath>) && !__has_include(<ext/__hash>)
124
# ifdef NLIB_CXX11_STDLIB_ATOMIC
125
# undef NLIB_CXX11_STDLIB_ATOMIC
126
# endif
127
# ifdef NLIB_HAS_NATIVE_TYPETRAITS
128
# undef NLIB_HAS_NATIVE_TYPETRAITS
129
# endif
130
# ifdef NLIB_CXX11_STDLIB_RANDOM
131
# undef NLIB_CXX11_STDLIB_RANDOM
132
# endif
133
#endif
134
135
// libstdc++ workaround, See https://svn.boost.org/trac/boost/ticket/7473
136
#if !__has_include(<future>)
137
# ifdef NLIB_CXX11_UNIQUEPTR
138
# undef NLIB_CXX11_UNIQUEPTR
139
# endif
140
# ifdef NLIB_CXX11_STDLIB_UNORDERED
141
# undef NLIB_CXX11_STDLIB_UNORDERED
142
# endif
143
# ifdef NLIB_CXX11_STDLIB_TUPLE
144
# undef NLIB_CXX11_STDLIB_TUPLE
145
# endif
146
#endif
147
148
#endif
149
#endif // INCLUDE_NN_NLIB_CONFIG_CLANG_H_
© 2012-2017 Nintendo Co., Ltd. All rights reserved.