diff options
| author | Max Brazhnikov <makc@FreeBSD.org> | 2026-05-14 09:29:47 +0000 |
|---|---|---|
| committer | Max Brazhnikov <makc@FreeBSD.org> | 2026-05-14 09:29:47 +0000 |
| commit | 736716fcf0f886becc8892adfd6596bc7d405ce9 (patch) | |
| tree | 9e825db2358a930417e7d47bbdaa70dd7db35886 | |
| parent | 096b98294a10abc71b3820c0f21ee9d2891266f5 (diff) | |
games/colobot: Backport upstream patch to fix build with modern compilers
| -rw-r--r-- | games/colobot/files/patch-src_app_main.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/games/colobot/files/patch-src_app_main.cpp b/games/colobot/files/patch-src_app_main.cpp new file mode 100644 index 000000000000..3885b67a4c52 --- /dev/null +++ b/games/colobot/files/patch-src_app_main.cpp @@ -0,0 +1,25 @@ +--- src/app/main.cpp ++++ src/app/main.cpp +@@ -94,10 +94,14 @@ The current layout is the following: + - src/script - link with the CBot library + */ + +-//! Entry point to the program ++// On *some* platforms, SDL declares a macro which renames main to SDL_main. ++// If that's the case, use "extern C" to prevent name mangling. ++#ifdef main + extern "C" + { ++#endif + ++//! Entry point to the program + int main(int argc, char *argv[]) + { + CLogger logger; // single instance of logger +@@ -176,4 +180,6 @@ int main(int argc, char *argv[]) + return code; + } + ++#ifdef main + } // extern "C" ++#endif |
