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 - SDL_syswm.h with SDL_PROTOTYPES_ONLY broken in C++ mode
Summary: SDL_syswm.h with SDL_PROTOTYPES_ONLY broken in C++ mode
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 2.0.9
Hardware: x86_64 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-06 17:27 UTC by Daniel Scharrer
Modified: 2018-11-06 19:06 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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..