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 4362

Summary: SDL_syswm.h with SDL_PROTOTYPES_ONLY broken in C++ mode
Product: SDL Reporter: Daniel Scharrer <daniel>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: sezeroz
Version: 2.0.9   
Hardware: x86_64   
OS: Linux   

Description Daniel Scharrer 2018-11-06 17:27:24 UTC
$ cat test.cpp 
#include <SDL.h>
#define SDL_PROTOTYPES_ONLY 1
#include <SDL_syswm.h>

int main() { }

$ g++ $(pkg-config sdl2 --cflags --libs) test.cpp
In file included from test.cpp:3:
/usr/include/SDL2/SDL_syswm.h:318:1: error: expected declaration before ‘}’ token
 }
 ^
Comment 1 Ozkan Sezer 2018-11-06 17:51:05 UTC
Should  be fixed by https://hg.libsdl.org/SDL/rev/244cdac21bcd
Thanks.
Comment 2 Ozkan Sezer 2018-11-06 19:06:27 UTC
BTW, this was broken in C-only mode too when SDL_PROTOTYPES_ONLY
was defined,  because it included close_code.h without including
begin_code.h first, possibly messing with structure packings..