Thunks/Host: Adds bool operator to fex_guest_function_ptr

Lets us check if nullptr was passed in
This commit is contained in:
Ryan Houdek committed 2022-10-10 08:52:50 -07:00
1 parent b44b3401b7
commit df3d398d31
1 file changed
+5 -1
+5 -1
View File
@@ -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) \