diff options
author | 2023-03-26 16:35:20 +1100 | |
---|---|---|
committer | 2023-03-26 16:35:20 +1100 | |
commit | 8ae9024b19e458c9362dd2a6c22f338d7990e750 (patch) | |
tree | 3d5f877caf3163447c026acb11baa494caf782b4 | |
parent | e79f5257b015499ef58dc3e52609b589d9b604bb (diff) |
input/input_dinput.h: Work around inability to have stdcall non-capturing lambdas (fixes 32-bit MinGW build).
-rw-r--r-- | src/osd/modules/input/input_dinput.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/osd/modules/input/input_dinput.h b/src/osd/modules/input/input_dinput.h index 991444a7cce..037c9c0c511 100644 --- a/src/osd/modules/input/input_dinput.h +++ b/src/osd/modules/input/input_dinput.h @@ -87,12 +87,16 @@ public: template <typename T> HRESULT enum_attached_devices(int devclass, T &&callback) const { + struct helper + { + static BOOL CALLBACK callback(LPCDIDEVICEINSTANCE instance, LPVOID ref) + { + return (*reinterpret_cast<T *>(ref))(instance); + } + }; return m_dinput->EnumDevices( devclass, - [] (LPCDIDEVICEINSTANCE instance, LPVOID ref) -> BOOL - { - return (*reinterpret_cast<T *>(ref))(instance); - }, + &helper::callback, reinterpret_cast<LPVOID>(&callback), DIEDFL_ATTACHEDONLY); } |