mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-09 19:36:29 +00:00
Removed extern "C" linkage from main() declaration
According to the C++ spec, main() should not have any linkage specifier: https://en.cppreference.com/w/cpp/language/main_function Fixes https://github.com/libsdl-org/SDL/issues/8738
This commit is contained in:
@@ -72,12 +72,6 @@ int SDL_main(int argc, char **argv)
|
||||
#define WINAPI __stdcall
|
||||
#endif
|
||||
|
||||
#include <SDL3/SDL_begin_code.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct HINSTANCE__ * HINSTANCE;
|
||||
typedef char* LPSTR;
|
||||
typedef wchar_t* PWSTR;
|
||||
@@ -119,12 +113,6 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw)
|
||||
return SDL_RunApp(0, NULL, SDL_main, NULL);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#include <SDL3/SDL_close_code.h>
|
||||
|
||||
/* end of __WIN32__ and __GDK__ impls */
|
||||
#elif defined(__WINRT__)
|
||||
|
||||
@@ -196,23 +184,11 @@ TInt E32Main()
|
||||
|
||||
#else /* platforms that use a standard main() and just call SDL_RunApp(), like iOS and 3DS */
|
||||
|
||||
#include <SDL3/SDL_begin_code.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
return SDL_RunApp(argc, argv, SDL_main, NULL);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#include <SDL3/SDL_close_code.h>
|
||||
|
||||
/* end of impls for standard-conforming platforms */
|
||||
|
||||
#endif /* __WIN32__ etc */
|
||||
|
Reference in New Issue
Block a user