31#ifndef ETL_DETERMINE_BUILTIN_SUPPORT_H_INCLUDED
32#define ETL_DETERMINE_BUILTIN_SUPPORT_H_INCLUDED
34#if defined(ETL_USE_TYPE_TRAITS_BUILTINS)
36 #if !defined(ETL_USING_BUILTIN_IS_ASSIGNABLE)
37 #define ETL_USING_BUILTIN_IS_ASSIGNABLE 1
40 #if !defined(ETL_USING_BUILTIN_IS_CONSTRUCTIBLE)
41 #define ETL_USING_BUILTIN_IS_CONSTRUCTIBLE 1
44 #if !defined(ETL_USING_BUILTIN_IS_NOTHROW_CONSTRUCTIBLE)
45 #define ETL_USING_BUILTIN_IS_NOTHROW_CONSTRUCTIBLE 1
48 #if !defined(ETL_USING_BUILTIN_IS_NOTHROW_ASSIGNABLE)
49 #define ETL_USING_BUILTIN_IS_NOTHROW_ASSIGNABLE 1
52 #if !defined(ETL_USING_BUILTIN_IS_TRIVIALLY_CONSTRUCTIBLE)
53 #define ETL_USING_BUILTIN_IS_TRIVIALLY_CONSTRUCTIBLE 1
56 #if !defined(ETL_USING_BUILTIN_IS_TRIVIALLY_DESTRUCTIBLE)
57 #define ETL_USING_BUILTIN_IS_TRIVIALLY_DESTRUCTIBLE 1
60 #if !defined(ETL_USING_BUILTIN_IS_TRIVIALLY_COPYABLE)
61 #define ETL_USING_BUILTIN_IS_TRIVIALLY_COPYABLE 1
64 #if !defined(ETL_USING_BUILTIN_UNDERLYING_TYPE)
65 #define ETL_USING_BUILTIN_UNDERLYING_TYPE 1
68 #if !defined(ETL_USING_BUILTIN_IS_CONSTANT_EVALUATED)
69 #define ETL_USING_BUILTIN_IS_CONSTANT_EVALUATED 1
73#if defined(ETL_USE_BUILTIN_MEM_FUNCTIONS)
75 #if !defined(ETL_USING_BUILTIN_MEMCPY)
76 #define ETL_USING_BUILTIN_MEMCPY 1
79 #if !defined(ETL_USING_BUILTIN_MEMMOVE)
80 #define ETL_USING_BUILTIN_MEMMOVE 1
83 #if !defined(ETL_USING_BUILTIN_MEMSET)
84 #define ETL_USING_BUILTIN_MEMSET 1
87 #if !defined(ETL_USING_BUILTIN_MEMCMP)
88 #define ETL_USING_BUILTIN_MEMCMP 1
91 #if !defined(ETL_USING_BUILTIN_MEMCHR)
92 #define ETL_USING_BUILTIN_MEMCHR 1
96#if defined(__has_builtin) && !defined(ETL_COMPILER_MICROSOFT)
99 #if !defined(ETL_USING_BUILTIN_IS_ASSIGNABLE)
100 #define ETL_USING_BUILTIN_IS_ASSIGNABLE __has_builtin(__is_assignable)
103 #if !defined(ETL_USING_BUILTIN_IS_CONSTRUCTIBLE)
104 #define ETL_USING_BUILTIN_IS_CONSTRUCTIBLE __has_builtin(__is_constructible)
107 #if !defined(ETL_USING_BUILTIN_IS_NOTHROW_CONSTRUCTIBLE)
108 #define ETL_USING_BUILTIN_IS_NOTHROW_CONSTRUCTIBLE __has_builtin(__is_nothrow_constructible)
111 #if !defined(ETL_USING_BUILTIN_IS_NOTHROW_ASSIGNABLE)
112 #define ETL_USING_BUILTIN_IS_NOTHROW_ASSIGNABLE __has_builtin(__is_nothrow_assignable)
115 #if !defined(ETL_USING_BUILTIN_IS_TRIVIALLY_CONSTRUCTIBLE)
116 #define ETL_USING_BUILTIN_IS_TRIVIALLY_CONSTRUCTIBLE (__has_builtin(__has_trivial_constructor) || __has_builtin(__is_trivially_constructible))
119 #if !defined(ETL_USING_BUILTIN_IS_TRIVIALLY_DESTRUCTIBLE)
120 #define ETL_USING_BUILTIN_IS_TRIVIALLY_DESTRUCTIBLE (__has_builtin(__has_trivial_destructor) || __has_builtin(__is_trivially_destructible))
123 #if !defined(ETL_USING_BUILTIN_IS_TRIVIALLY_COPYABLE)
124 #define ETL_USING_BUILTIN_IS_TRIVIALLY_COPYABLE (__has_builtin(__has_trivial_copy) || __has_builtin(__is_trivially_copyable))
127 #if !defined(ETL_USING_BUILTIN_UNDERLYING_TYPE)
128 #define ETL_USING_BUILTIN_UNDERLYING_TYPE __has_builtin(__underlying_type)
131 #if !defined(ETL_USING_BUILTIN_IS_CONSTANT_EVALUATED)
132 #define ETL_USING_BUILTIN_IS_CONSTANT_EVALUATED __has_builtin(__builtin_is_constant_evaluated)
135 #if !defined(ETL_USING_BUILTIN_MEMCPY)
136 #define ETL_USING_BUILTIN_MEMCPY __has_builtin(__builtin_memcpy)
139 #if !defined(ETL_USING_BUILTIN_MEMMOVE)
140 #define ETL_USING_BUILTIN_MEMMOVE __has_builtin(__builtin_memmove)
143 #if !defined(ETL_USING_BUILTIN_MEMSET)
144 #define ETL_USING_BUILTIN_MEMSET __has_builtin(__builtin_memset)
147 #if !defined(ETL_USING_BUILTIN_MEMCMP)
148 #define ETL_USING_BUILTIN_MEMCMP __has_builtin(__builtin_memcmp)
151 #if !defined(ETL_USING_BUILTIN_MEMCHR)
152 #define ETL_USING_BUILTIN_MEMCHR __has_builtin(__builtin_memchr)
155 #if !defined(ETL_USING_BUILTIN_IS_VIRTUAL_BASE_OF)
156 #define ETL_USING_BUILTIN_IS_VIRTUAL_BASE_OF __has_builtin(__is_virtual_base_of)
159 #if !defined(ETL_USING_BUILTIN_IS_TRIVIALLY_RELOCATABLE)
160 #define ETL_USING_BUILTIN_IS_TRIVIALLY_RELOCATABLE __has_builtin(__is_trivially_relocatable)
165 #if !defined(ETL_USING_BUILTIN_BUILTIN_IS_CPP_TRIVIALLY_RELOCATABLE)
166 #define ETL_USING_BUILTIN_BUILTIN_IS_CPP_TRIVIALLY_RELOCATABLE __has_builtin(__builtin_is_cpp_trivially_relocatable)
170#if defined(ETL_COMPILER_MICROSOFT)
174 #if !defined(ETL_USING_BUILTIN_IS_TRIVIALLY_COPYABLE)
175 #define ETL_USING_BUILTIN_IS_TRIVIALLY_COPYABLE 1
180#if !defined(ETL_USING_BUILTIN_IS_ASSIGNABLE)
181 #define ETL_USING_BUILTIN_IS_ASSIGNABLE 0
184#if !defined(ETL_USING_BUILTIN_IS_CONSTRUCTIBLE)
185 #define ETL_USING_BUILTIN_IS_CONSTRUCTIBLE 0
188#if !defined(ETL_USING_BUILTIN_IS_NOTHROW_CONSTRUCTIBLE)
189 #define ETL_USING_BUILTIN_IS_NOTHROW_CONSTRUCTIBLE 0
192#if !defined(ETL_USING_BUILTIN_IS_NOTHROW_ASSIGNABLE)
193 #define ETL_USING_BUILTIN_IS_NOTHROW_ASSIGNABLE 0
196#if !defined(ETL_USING_BUILTIN_IS_TRIVIALLY_CONSTRUCTIBLE)
197 #define ETL_USING_BUILTIN_IS_TRIVIALLY_CONSTRUCTIBLE 0
200#if !defined(ETL_USING_BUILTIN_IS_TRIVIALLY_DESTRUCTIBLE)
201 #define ETL_USING_BUILTIN_IS_TRIVIALLY_DESTRUCTIBLE 0
204#if !defined(ETL_USING_BUILTIN_IS_TRIVIALLY_COPYABLE)
205 #define ETL_USING_BUILTIN_IS_TRIVIALLY_COPYABLE 0
208#if !defined(ETL_USING_BUILTIN_UNDERLYING_TYPE)
209 #define ETL_USING_BUILTIN_UNDERLYING_TYPE 0
212#if !defined(ETL_USING_BUILTIN_IS_CONSTANT_EVALUATED)
213 #define ETL_USING_BUILTIN_IS_CONSTANT_EVALUATED 0
216#if !defined(ETL_USING_BUILTIN_MEMCPY)
217 #define ETL_USING_BUILTIN_MEMCPY 0
220#if !defined(ETL_USING_BUILTIN_MEMMOVE)
221 #define ETL_USING_BUILTIN_MEMMOVE 0
224#if !defined(ETL_USING_BUILTIN_MEMSET)
225 #define ETL_USING_BUILTIN_MEMSET 0
228#if !defined(ETL_USING_BUILTIN_MEMCMP)
229 #define ETL_USING_BUILTIN_MEMCMP 0
232#if !defined(ETL_USING_BUILTIN_MEMCHR)
233 #define ETL_USING_BUILTIN_MEMCHR 0
236#if !defined(ETL_USING_BUILTIN_IS_VIRTUAL_BASE_OF)
237 #define ETL_USING_BUILTIN_IS_VIRTUAL_BASE_OF 0
240#if !defined(ETL_USING_BUILTIN_IS_TRIVIALLY_RELOCATABLE)
241 #define ETL_USING_BUILTIN_IS_TRIVIALLY_RELOCATABLE 0
244#if !defined(ETL_USING_BUILTIN_BUILTIN_IS_CPP_TRIVIALLY_RELOCATABLE)
245 #define ETL_USING_BUILTIN_BUILTIN_IS_CPP_TRIVIALLY_RELOCATABLE 0
254 static ETL_CONSTANT
bool using_builtin_is_assignable = (ETL_USING_BUILTIN_IS_ASSIGNABLE == 1);
255 static ETL_CONSTANT
bool using_builtin_is_constructible = (ETL_USING_BUILTIN_IS_CONSTRUCTIBLE == 1);
256 static ETL_CONSTANT
bool using_builtin_is_nothrow_constructible = (ETL_USING_BUILTIN_IS_NOTHROW_CONSTRUCTIBLE == 1);
257 static ETL_CONSTANT
bool using_builtin_is_nothrow_assignable = (ETL_USING_BUILTIN_IS_NOTHROW_ASSIGNABLE == 1);
258 static ETL_CONSTANT
bool using_builtin_is_trivially_constructible = (ETL_USING_BUILTIN_IS_TRIVIALLY_CONSTRUCTIBLE == 1);
259 static ETL_CONSTANT
bool using_builtin_is_trivially_destructible = (ETL_USING_BUILTIN_IS_TRIVIALLY_DESTRUCTIBLE == 1);
260 static ETL_CONSTANT
bool using_builtin_is_trivially_copyable = (ETL_USING_BUILTIN_IS_TRIVIALLY_COPYABLE == 1);
261 static ETL_CONSTANT
bool using_builtin_underlying_type = (ETL_USING_BUILTIN_UNDERLYING_TYPE == 1);
262 static ETL_CONSTANT
bool using_builtin_is_constant_evaluated = (ETL_USING_BUILTIN_IS_CONSTANT_EVALUATED == 1);
263 static ETL_CONSTANT
bool using_builtin_memcpy = (ETL_USING_BUILTIN_MEMCPY == 1);
264 static ETL_CONSTANT
bool using_builtin_memmove = (ETL_USING_BUILTIN_MEMMOVE == 1);
265 static ETL_CONSTANT
bool using_builtin_memset = (ETL_USING_BUILTIN_MEMSET == 1);
266 static ETL_CONSTANT
bool using_builtin_memcmp = (ETL_USING_BUILTIN_MEMCMP == 1);
267 static ETL_CONSTANT
bool using_builtin_memchr = (ETL_USING_BUILTIN_MEMCHR == 1);
268 static ETL_CONSTANT
bool using_builtin_is_virtual_base_of = (ETL_USING_BUILTIN_IS_VIRTUAL_BASE_OF == 1);
269 static ETL_CONSTANT
bool using_builtin_is_trivially_relocatable = (ETL_USING_BUILTIN_IS_TRIVIALLY_RELOCATABLE == 1);
270 static ETL_CONSTANT
bool using_builtin_builtin_is_cpp_trivially_relocatable = (ETL_USING_BUILTIN_BUILTIN_IS_CPP_TRIVIALLY_RELOCATABLE == 1);