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 2932

Summary: windows joystick and haptic c source files: wrong guards
Product: SDL Reporter: Martin Gerhardy <martin.gerhardy>
Component: buildAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: icculus
Version: HG 2.1Keywords: target-2.0.4
Hardware: x86_64   
OS: Linux   

Description Martin Gerhardy 2015-04-07 17:00:11 UTC
It's not possible to skip the files when you build for linux, because the guards are either wrongly placed or missing. Every other subsystems work - only joystick and haptic don't.
Comment 1 Ryan C. Gordon 2015-04-08 01:44:00 UTC
What should be there? I see "#if SDL_JOYSTICK_DINPUT" (etc) on each of the Windows files. I might be misunderstanding the issue here.

--ryan.
Comment 2 Martin Gerhardy 2015-04-08 06:38:02 UTC
The "problem" is that there are header inclusions above the guard(s). I think there should only be one header inclusion above the guards - the one that defines the guards.

Some of the "unprotected" header inclusions include windows.h at some place without a windows guard (which is fine - that's not my issue).

So basically it's all about moving the header inclusions into the guarded part except the one that defines the guard.
Comment 3 Ryan C. Gordon 2015-04-09 05:39:20 UTC
(In reply to Martin Gerhardy from comment #2)
> So basically it's all about moving the header inclusions into the guarded
> part except the one that defines the guard.

Oh, I understand now. Ok, I'll try to fix that for 2.0.4.

--ryan.
Comment 4 Ryan C. Gordon 2015-05-28 04:55:55 UTC
Should be fixed by https://hg.libsdl.org/SDL/rev/9753468b5c0e, please let me know if it still causes you problems.

--ryan.