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:32:17 +0000 |
| commit | 8eb68e1515be80756f628b3bf1cfc6e75115b418 (patch) | |
| tree | b30faded72c5a61f7803218c281e91ac33731952 | |
| parent | ea55b6c494865fd07f6a4f16367a424ccafefd3c (diff) | |
games/colobot: Backport upstream patch to fix build with modern compilers
(cherry picked from commit 736716fcf0f886becc8892adfd6596bc7d405ce9)
| -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 |
