From 03fc5eebcbf82709f70f25f2c5a7e7c2d92df599 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 19 Mar 2019 10:56:46 -0700 Subject: [PATCH] Fixed building with C++ --- include/SDL_main.h | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/include/SDL_main.h b/include/SDL_main.h index 7a17ede87..b3674885a 100644 --- a/include/SDL_main.h +++ b/include/SDL_main.h @@ -86,12 +86,6 @@ #endif #endif /* SDL_MAIN_HANDLED */ -#ifdef __cplusplus -#define C_LINKAGE "C" -#else -#define C_LINKAGE -#endif /* __cplusplus */ - #ifndef SDLMAIN_DECLSPEC #define SDLMAIN_DECLSPEC #endif @@ -115,21 +109,18 @@ #define main SDL_main #endif -/** - * The prototype for the application's main() function - */ -#ifdef __cplusplus -extern "C" -#endif -typedef int (*SDL_main_func)(int argc, char *argv[]); -extern C_LINKAGE SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[]); - - #include "begin_code.h" #ifdef __cplusplus extern "C" { #endif +/** + * The prototype for the application's main() function + */ +typedef int (*SDL_main_func)(int argc, char *argv[]); +extern C_LINKAGE SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[]); + + /** * This is called by the real SDL main function to let the rest of the * library know that initialization was done properly.