ae2f::Core
Loading...
Searching...
No Matches
Cast.h
Go to the documentation of this file.
1#if !defined(ae2f_Macro_Cast_h)
2
5#define ae2f_Macro_Cast_h
6
10#define ae2f_Macro_Cast_Console_Clear_Cheat "\033[2J\033[H"
11
14#define ae2f_Macro_Cast_Merge(...) __VA_ARGS__
15
16#include <stdbool.h>
17#include <stddef.h>
18
19#if defined(__cplusplus)
20
21#include "Cast/CasterUnion.hpp"
22
25#define ae2f_add_when_cxx(...) __VA_ARGS__
26
29#define ae2f_add_when_c(...)
30
31#else
32
35#define ae2f_add_when_cxx(...)
36
39#define ae2f_add_when_c(...) __VA_ARGS__
40
41#endif // defined(__cplusplus)
42
45#define ae2f_record_make(type, ...) (ae2f_add_when_c((type) { __VA_ARGS__ }) ae2f_add_when_cxx(type{ __VA_ARGS__ }))
46
49#define ae2f_static_cast(t, v) ae2f_add_when_c(((t)(v))) ae2f_add_when_cxx(static_cast<t>(v))
50
53#define ae2f_dynamic_cast(t, v) ae2f_add_when_c(((t)(v))) ae2f_add_when_cxx(dynamic_cast<t>(v))
54
57#define ae2f_reinterpret_cast(t, v) ae2f_add_when_c(((t)(v))) ae2f_add_when_cxx(reinterpret_cast<t>(v))
58
61#define ae2f_const_cast(t, v) ae2f_add_when_c(((t)(v))) ae2f_add_when_cxx(const_cast<t>(v))
62
74#define ae2f_union_cast(tThen, tNow, v) ae2f_add_when_c((union { tThen a; tNow b; }) { v }) ae2f_add_when_cxx(ae2f_union_caster<tThen, tNow>{ v }) .b
75
81#define ae2f_struct ae2f_add_when_c(struct)
82
85#define ae2f_extern ae2f_add_when_c(extern) ae2f_add_when_cxx(extern "C")
86
89#define ae2f_class ae2f_add_when_c(struct) ae2f_add_when_cxx(class)
90
93#define ae2f_var ae2f_add_when_cxx(extern "C")
94
97#define ae2f_fdef(rtn_t, name, ...) rtn_t (*name)(__VA_ARGS__)
98
99#endif