We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4245

Summary: MSVC build is broken in SDL_sensor.c
Product: SDL Reporter: Vitaly Novichkov <admin>
Component: buildAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: major    
Priority: P2 CC: sezeroz
Version: HG 2.1   
Hardware: All   
OS: Windows (All)   

Description Vitaly Novichkov 2018-09-02 14:31:33 UTC
Once upon I have run AppVeyor build of my audio codecs pack and SDL2 that was pulled from the official HG repository, was failed on every MSVC of any configuration I have made:

```
C:\projects\audiocodecs\build-MSVC15-Debug-x64\external\SDL2\src\SDL2HG\src\sensor\SDL_sensor.c(45): error C2059: syntax error: '}' [C:\projects\audiocodecs\build-MSVC15-Debug-x64\external\SDL2\src\SDL2HG-build\SDL2.vcxproj] [C:\projects\audiocodecs\build-MSVC15-Debug-x64\SDL2HG.vcxproj]
C:\projects\audiocodecs\build-MSVC15-Debug-x64\external\SDL2\src\SDL2HG\src\sensor\SDL_sensor.c(85): warning C4034: sizeof returns 0 [C:\projects\audiocodecs\build-MSVC15-Debug-x64\external\SDL2\src\SDL2HG-build\SDL2.vcxproj] [C:\projects\audiocodecs\build-MSVC15-Debug-x64\SDL2HG.vcxproj]
C:\projects\audiocodecs\build-MSVC15-Debug-x64\external\SDL2\src\SDL2HG\src\sensor\SDL_sensor.c(101): warning C4034: sizeof returns 0 [C:\projects\audiocodecs\build-MSVC15-Debug-x64\external\SDL2\src\SDL2HG-build\SDL2.vcxproj] [C:\projects\audiocodecs\build-MSVC15-Debug-x64\SDL2HG.vcxproj]
C:\projects\audiocodecs\build-MSVC15-Debug-x64\external\SDL2\src\SDL2HG\src\sensor\SDL_sensor.c(127): warning C4034: sizeof returns 0 [C:\projects\audiocodecs\build-MSVC15-Debug-x64\external\SDL2\src\SDL2HG-build\SDL2.vcxproj] [C:\projects\audiocodecs\build-MSVC15-Debug-x64\SDL2HG.vcxproj]
C:\projects\audiocodecs\build-MSVC15-Debug-x64\external\SDL2\src\SDL2HG\src\sensor\SDL_sensor.c(456): warning C4034: sizeof returns 0 [C:\projects\audiocodecs\build-MSVC15-Debug-x64\external\SDL2\src\SDL2HG-build\SDL2.vcxproj] [C:\projects\audiocodecs\build-MSVC15-Debug-x64\SDL2HG.vcxproj]
C:\projects\audiocodecs\build-MSVC15-Debug-x64\external\SDL2\src\SDL2HG\src\sensor\SDL_sensor.c(539): warning C4034: sizeof returns 0 [C:\projects\audiocodecs\build-MSVC15-Debug-x64\external\SDL2\src\SDL2HG-build\SDL2.vcxproj] [C:\projects\audiocodecs\build-MSVC15-Debug-x64\SDL2HG.vcxproj]
```

Lost of MSVC build configs where failed:
https://ci.appveyor.com/project/Wohlstand/audiocodecs/build/1.0.147
And here:
https://ci.appveyor.com/project/Wohlstand/audiocodecs/build/1.0.148
Comment 1 Ozkan Sezer 2018-09-02 17:50:25 UTC
Can build with the included MSVC project file. no errors
(VS2017 15.8.2, x86 and x64 release configurations.)  Is
something wrong with the cmake-generated SDL_config.h?
Comment 2 Ozkan Sezer 2018-09-02 18:15:11 UTC
Tried with cmake, and I had in the config:

/* #undef SDL_SENSOR_DISABLED */
[...]
/* #undef SDL_SENSOR_DUMMY */

As a result, SDL_sensor_drivers[] is zero sized.
Comment 3 Vitaly Novichkov 2018-09-02 19:38:30 UTC
My stuff is fully built via CMake. I don't use MSVC projects as CMake is able to regenerate them for any config.
Comment 4 Ozkan Sezer 2018-09-02 21:00:44 UTC
Should be fixed by http://hg.libsdl.org/SDL/rev/26a817fe1b07

I did not define SDL_SENSOR_DUMMY in there, because:
- no other SDL_xxx_DUMMY is defined in that section, and
- autofoo (configure.in) doesn't define it, either.
Comment 5 Vitaly Novichkov 2018-09-03 00:02:43 UTC
Thanks!
Now that thing was finally built!
https://ci.appveyor.com/project/Wohlstand/audiocodecs/build/1.0.149