Skip to content

Commit f6a979d

Browse files
committed
events: Buildfix for targets with C++ build units
1 parent f4b937a commit f6a979d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/events/SDL_windowevents_c.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
#ifndef SDL_windowevents_c_h_
2424
#define SDL_windowevents_c_h_
2525

26+
// Set up for C function definitions, even when using C++
27+
#ifdef __cplusplus
28+
extern "C" {
29+
#endif
30+
2631
typedef enum
2732
{
2833
SDL_WINDOW_EVENT_WATCH_EARLY,
@@ -36,4 +41,9 @@ extern void SDL_RemoveWindowEventWatch(SDL_WindowEventWatchPriority priority, SD
3641

3742
extern bool SDL_SendWindowEvent(SDL_Window *window, SDL_EventType windowevent, int data1, int data2);
3843

44+
// Ends C function definitions when using C++
45+
#ifdef __cplusplus
46+
}
47+
#endif
48+
3949
#endif // SDL_windowevents_c_h_

0 commit comments

Comments
 (0)