mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 13:00:15 +02:00
Thunks/Host: Adds bool operator to fex_guest_function_ptr
Lets us check if nullptr was passed in
This commit is contained in:
1 parent
b44b3401b7
commit
df3d398d31
1 file changed
+5
-1
@@ -61,13 +61,17 @@ typedef void fex_call_callback_t(uintptr_t callback, void *arg0, void* arg1);
|
||||
*/
|
||||
struct fex_guest_function_ptr {
|
||||
private:
|
||||
[[maybe_unused]] void* value = nullptr;
|
||||
void* value = nullptr;
|
||||
|
||||
public:
|
||||
fex_guest_function_ptr() = default;
|
||||
|
||||
template<typename Ret, typename... Args>
|
||||
fex_guest_function_ptr(Ret (*ptr)(Args...)) : value(reinterpret_cast<void*>(ptr)) {}
|
||||
|
||||
inline operator bool() const {
|
||||
return value != nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
#define EXPORTS(name) \
|
||||
|
||||
Reference in new issue
Block a user