mirror of
https://github.com/holub/mame
synced 2025-04-19 23:12:11 +03:00
input/input_dinput.h: Work around inability to have stdcall non-capturing lambdas (fixes 32-bit MinGW build).
This commit is contained in:
parent
e79f5257b0
commit
8ae9024b19
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user