mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-17 02:08:27 +00:00
Fix SDL_main on UWP with C++20
/ZW is incompatible with C++20, so disable the #error in that case. In addition, define a main function because UWP in C++20 mode links to standard main.
This commit is contained in:
parent
8eeaa815d9
commit
2f8cfce154
1 changed files with 6 additions and 1 deletions
|
@ -151,7 +151,7 @@
|
||||||
setting through the dialog that comes up.
|
setting through the dialog that comes up.
|
||||||
*/
|
*/
|
||||||
#ifndef SDL_WINRT_METADATA_FILE_AVAILABLE
|
#ifndef SDL_WINRT_METADATA_FILE_AVAILABLE
|
||||||
#if !defined(__cplusplus) || !defined(__cplusplus_winrt)
|
#if !defined(__cplusplus) || (!defined(__cplusplus_winrt) && _MSVC_LANG < 202002L)
|
||||||
#error The C++ file that includes SDL_main.h must be compiled as C++ code with /ZW, otherwise build errors due to missing .winmd files can occur.
|
#error The C++ file that includes SDL_main.h must be compiled as C++ code with /ZW, otherwise build errors due to missing .winmd files can occur.
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -177,6 +177,11 @@
|
||||||
{
|
{
|
||||||
return SDL_RunApp(0, NULL, SDL_main, NULL);
|
return SDL_RunApp(0, NULL, SDL_main, NULL);
|
||||||
}
|
}
|
||||||
|
#if _MSVC_LANG >= 202002L
|
||||||
|
int main(int argc, char** argv) {
|
||||||
|
return SDL_RunApp(argc, argv, SDL_main, NULL);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue