protonscr

joystick_osx.c fails to compile on MacOS

protonclosed
ValveSoftware/Proton#203 · opened 2018-08-23 by konistehrad · updated 2018-08-24 · 3 comments · github
Kkonistehrad 2018-08-23 github

Looks like a simple scoping issue. The error itself is:

/Users/conrad/Developer/Proton/wine/dlls/dinput/joystick_osx.c:1010:49: error: use of undeclared identifier 'device'
        lpddi->guidProduct.Data1 = make_vid_pid(device);

Here's the block in question, link to upstream source:

        if (dwFlags & DIEDFL_FORCEFEEDBACK) {
            IOHIDDeviceRef device = get_device_ref(id);
            if(!device)
                return S_FALSE;
            if(get_ff(device, NULL) != S_OK)
                return S_FALSE;
        }
        /* Return joystick */
        lpddi->guidInstance = DInput_Wine_OsX_Joystick_GUID;
        lpddi->guidInstance.Data3 = id;
        lpddi->guidProduct = DInput_Wine_OsX_Joystick_GUID;
        lpddi->guidProduct.Data1 = make_vid_pid(device);

Offending commit: https://github.com/ValveSoftware/wine/blame/1c79a38ca494d9e32fee9fc7543b7779b184c878/dlls/dinput/joystick_osx.c#L1010

Fflukejones 2018-08-23 github

Can confirm scoping issue - moving IOHIDDeviceRef device = get_device_ref(id); above the if block works fine.

Aaeikum 2018-08-24 github

Upstream links