Loading...
Searching...
No Matches
Go to the documentation of this file.
27#ifndef FENNEC_LANG_INTRINSICS_H
28#define FENNEC_LANG_INTRINSICS_H
103#if defined(__has_builtin)
109#if __has_builtin(__builtin_addressof)
110# define FENNEC_HAS_BUILTIN_ADDRESSOF 1
111# define FENNEC_BUILTIN_ADDRESSOF(arg) __builtin_addressof(arg)
113# define FENNEC_HAS_BUILTIN_ADDRESSOF 0
117#if __has_builtin(__builtin_bit_cast)
118# define FENNEC_HAS_BUILTIN_BIT_CAST 1
119# define FENNEC_BUILTIN_BIT_CAST(type, arg) __builtin_bit_cast(type, arg)
121# define FENNEC_HAS_BUILTIN_BIT_CAST 0
124#if __has_builtin(__builtin_LINE)
125# define FENNEC_HAS_BUILTIN_LINE 1
126# define FENNEC_BUILTIN_LINE() __builtin_LINE()
128# define FENNEC_HAS_BUILTIN_LINE 0
131#if __has_builtin(__builtin_COLUMN)
132# define FENNEC_HAS_BUILTIN_COLUMN 1
133# define FENNEC_BUILTIN_COLUMN() __builtin_COLUMN()
135# define FENNEC_HAS_BUILTIN_COLUMN 0
138#if __has_builtin(__builtin_FILE)
139# define FENNEC_HAS_BUILTIN_FILE 1
140# define FENNEC_BUILTIN_FILE() __builtin_FILE()
142# define FENNEC_HAS_BUILTIN_FILE 0
145#if __has_builtin(__builtin_FUNCTION)
146# define FENNEC_HAS_BUILTIN_FUNCTION 1
147# define FENNEC_BUILTIN_FUNCTION() __builtin_FUNCTION()
149# define FENNEC_HAS_BUILTIN_FUNCTION 0
156#if __has_builtin(__is_abstract)
157# define FENNEC_HAS_BUILTIN_IS_ABSTRACT 1
158# define FENNEC_BUILTIN_IS_ABSTRACT(arg) __is_abstract(arg)
160# define FENNEC_HAS_BUILTIN_IS_ABSTRACT 0
164#if __has_builtin(__is_array)
165# define FENNEC_HAS_BUILTIN_IS_ARRAY 1
166# define FENNEC_BUILTIN_IS_ARRAY(arg) __is_array(arg)
168# define FENNEC_HAS_BUILTIN_IS_ARRAY
172#if __has_builtin(__is_class)
173# define FENNEC_HAS_BUILTIN_IS_CLASS 1
174# define FENNEC_BUILTIN_IS_CLASS(arg) __is_class(arg)
176# define FENNEC_HAS_BUILTIN_IS_CLASS
179#if __has_builtin(__is_member_pointer)
180# define FENNEC_HAS_BUILTIN_IS_MEMBER_POINTER 1
181# define FENNEC_BUILTIN_IS_MEMBER_POINTER(arg) __is_member_pointer(arg)
183# define FENNEC_HAS_BUILTIN_IS_MEMBER_POINTER 0
186#if __has_builtin(__is_member_function_pointer)
187# define FENNEC_HAS_BUILTIN_IS_MEMBER_FUNCTION_POINTER 1
188# define FENNEC_BUILTIN_IS_MEMBER_FUNCTION_POINTER(arg) __is_member_function_pointer(arg)
190# define FENNEC_HAS_BUILTIN_IS_MEMBER_FUNCTION_POINTER 0
193#if __has_builtin(__is_member_object_pointer)
194# define FENNEC_HAS_BUILTIN_IS_MEMBER_OBJECT_POINTER 1
195# define FENNEC_BUILTIN_IS_MEMBER_OBJECT_POINTER(arg) __is_member_object_pointer(arg)
197# define FENNEC_HAS_BUILTIN_IS_MEMBER_OBJECT_POINTER 0
204#if __has_builtin(__is_constructible)
205# define FENNEC_HAS_BUILTIN_IS_CONSTRUCTIBLE 1
206# define FENNEC_BUILTIN_IS_CONSTRUCTIBLE(type, ...) __is_constructible(type __VA_OPT__(,) __VA_ARGS__)
208# define FENNEC_HAS_BUILTIN_IS_CONSTRUCTIBLE 0
212#if __has_builtin(__is_trivially_constructible)
213# define FENNEC_HAS_BUILTIN_IS_TRIVIALLY_CONSTRUCTIBLE 1
214# define FENNEC_BUILTIN_IS_TRIVIALLY_CONSTRUCTIBLE(type) __is_trivially_constructible(type)
216# define FENNEC_HAS_BUILTIN_IS_TRIVIALLY_CONSTRUCTIBLE 0
220#if __has_builtin(__has_trivial_destructor)
221# define FENNEC_HAS_BUILTIN_IS_TRIVIALLY_DESTRUCTIBLE 1
222# define FENNEC_BUILTIN_IS_TRIVIALLY_DESTRUCTIBLE(type) __has_trivial_destructor(type)
224# define FENNEC_HAS_BUILTIN_IS_TRIVIALLY_DESTRUCTIBLE 0
231#if __has_builtin(__is_assignable)
232# define FENNEC_HAS_BUILTIN_IS_ASSIGNABLE 1
233# define FENNEC_BUILTIN_IS_ASSIGNABLE(a, b) __is_assignable(a, b)
235# define FENNEC_HAS_BUILTIN_IS_ASSIGNABLE 0
239#if __has_builtin(__is_trivial)
240# define FENNEC_HAS_BUILTIN_IS_TRIVIAL 1
241# define FENNEC_BUILTIN_IS_TRIVIAL(a) __is_trivial(a)
243# define FENNEC_HAS_BUILTIN_IS_TRIVIAL 0
247#if __has_builtin(__is_trivially_copyable)
248# define FENNEC_HAS_BUILTIN_IS_TRIVIALLY_COPYABLE 1
249# define FENNEC_BUILTIN_IS_TRIVIALLY_COPYABLE(a) __is_trivially_copyable(a)
251# define FENNEC_HAS_BUILTIN_IS_TRIVIALLY_COPYABLE 0
255#if __has_builtin(__is_standard_layout)
256# define FENNEC_HAS_BUILTIN_IS_STANDARD_LAYOUT 1
257# define FENNEC_BUILTIN_IS_STANDARD_LAYOUT(arg) __is_standard_layout(arg)
259# define FENNEC_HAS_BUILTIN_IS_STANDARD_LAYOUT 0
263#if __has_builtin(__has_unique_object_representations)
264# define FENNEC_HAS_BUILTIN_HAS_UNIQUE_OBJECT_REPRESENTATIONS 1
265# define FENNEC_BUILTIN_HAS_UNIQUE_OBJECT_REPRESENTATIONS(arg) __has_unique_object_representations(arg)
267# define FENNEC_HAS_BUILTIN_HAS_UNIQUE_OBJECT_REPRESENTATIONS 0
273#if __has_builtin(__is_convertible)
274# define FENNEC_HAS_BUILTIN_IS_CONVERTIBLE 1
275# define FENNEC_BUILTIN_IS_CONVERTIBLE(arg0, arg1) __is_convertible(arg0, arg1)
277# define FENNEC_HAS_BUILTIN_IS_CONVERTIBLE 0
281#if __has_builtin(__is_empty)
282# define FENNEC_HAS_BUILTIN_IS_EMPTY 1
283# define FENNEC_BUILTIN_IS_EMPTY(arg) __is_empty(arg)
285# define FENNEC_HAS_BUILTIN_IS_EMPTY 0
288#if __has_builtin(__is_final)
289# define FENNEC_HAS_BUILTIN_IS_FINAL 1
290# define FENNEC_BUILTIN_IS_FINAL(arg) __is_final(arg)
292# define FENNEC_HAS_BUILTIN_IS_FINAL 0
297#if __has_builtin(__is_enum)
298# define FENNEC_HAS_BUILTIN_IS_ENUM 1
299# define FENNEC_BUILTIN_IS_ENUM(arg) __is_enum(arg)
301# define FENNEC_HAS_BUILTIN_IS_ENUM 0
305#if __has_builtin(__is_union)
306# define FENNEC_HAS_BUILTIN_IS_UNION 1
307# define FENNEC_BUILTIN_IS_UNION(arg) __is_union(arg)
309# define FENNEC_HAS_BUILTIN_IS_UNION 0
313#if __has_builtin(__is_final)
314# define FENNEC_HAS_BUILTIN_IS_FINAL 1
315# define FENNEC_BUILTIN_IS_FINAL(arg) __is_final(arg)
317# define FENNEC_HAS_BUILTIN_IS_FINAL 0
321#if __has_builtin(__is_aggregate)
322# define FENNEC_HAS_BUILTIN_IS_AGGREGATE 1
323# define FENNEC_BUILTIN_IS_AGGREGATE(arg) __is_aggregate(arg)
325# define FENNEC_HAS_BUILTIN_IS_AGGREGATE 0
329#if __has_builtin(__builtin_is_implicit_lifetime)
330# define FENNEC_HAS_BUILTIN_IS_IMPLICIT_LIFETIME 1
331# define FENNEC_BUILTIN_IS_IMPLICIT_LIFETIME(arg) __builtin_is_implicit_lifetime(arg)
333# define FENNEC_HAS_BUILTIN_IS_IMPLICIT_LIFETIME 0
337#if __has_builtin(__is_function)
338# define FENNEC_HAS_BUILTIN_IS_FUNCTION 1
339# define FENNEC_BUILTIN_IS_FUNCTION(arg) __is_function(arg)
341# define FENNEC_HAS_BUILTIN_IS_FUNCTION 0
345#if __has_builtin(__is_object)
346# define FENNEC_HAS_BUILTIN_IS_OBJECT 1
347# define FENNEC_BUILTIN_IS_OBJECT(arg) __is_object(arg)
349# define FENNEC_HAS_BUILTIN_IS_FUNCTION 0
353#if __has_builtin(__is_polymorphic)
354# define FENNEC_HAS_BUILTIN_IS_POLYMORPHIC 1
355# define FENNEC_BUILTIN_IS_POLYMORPHIC(arg) __is_polymorphic(arg)
357# define FENNEC_HAS_BUILTIN_IS_POLYMORPHIC 0
366#if FENNEC_COMPILER_MSVC
368# define FENNEC_HAS_BUILTIN_ADDRESS_OF 1
369# define FENNEC_BUILTIN_ADDRESS_OF(arg) __builtin_addressof(arg)
371# define FENNEC_HAS_BUILTIN_BIT_CAST 1
372# define FENNEC_BUILTIN_BIT_CAST(type, arg) __builtin_bit_cast(type, arg)
374# define FENNEC_HAS_BUILTIN_IS_CONVERTIBLE 1
375# define FENNEC_BUILTIN_IS_CONVERTIBLE(arg0, arg1) __is_convertible_to(arg0, arg1)
377# define FENNEC_HAS_BUILTIN_IS_CONSTRUCTIBLE 1
378# define FENNEC_BUILTIN_IS_CONSTRUCTIBLE(...) __is_constructible(__VA_ARGS__)
380# define FENNEC_HAS_BUILTIN_IS_EMPTY 1
381# define FENNEC_BUILTIN_IS_EMPTY(arg) __is_empty(arg)
383# define FENNEC_HAS_BUILTIN_IS_FINAL 1
384# define FENNEC_BUILTIN_IS_FINAL(arg) __is_final(arg)
386# define FENNEC_HAS_BUILTIN_IS_POLYMORPHIC 1
387# define FENNEC_BUILTIN_IS_POLYMORPHIC(arg) __is_polymorphic(arg)
389# define FENNEC_HAS_BUILTIN_IS_STANDARD_LAYOUT 1
390# define FENNEC_BUILTIN_IS_STANDARD_LAYOUT(arg) __is_standard_layout(arg)