Skip to content

mingw compat - #1800

Merged
Flamefire merged 1 commit into
Return-To-The-Roots:masterfrom
yrrrmmbl:master
Oct 1, 2025
Merged

mingw compat#1800
Flamefire merged 1 commit into
Return-To-The-Roots:masterfrom
yrrrmmbl:master

Conversation

@yrrrmmbl

Copy link
Copy Markdown
Contributor

fix compilation under msys2 mingw

@Flamefire

Copy link
Copy Markdown
Member

Can you provide a bit more information what the actual issue is? I.e. the error message(s) would help.
In general it looks fine, just the kaguya change is a bit suspicious and won't work in general/all environments. What is the issue that this should fix?

@yrrrmmbl

Copy link
Copy Markdown
Contributor Author

the non kaguya changes fix a redefinition error and the kaguya change fixes a missing include in the kaguya code, where it seems the code is relying on the cstdint header being included by another standard library header.

cmake --build build/ -j 1
[1/622] Building CXX object libs/libGamedata/CMa...gamedata.dir/gameData/CampaignDescription.cpp.ob
FAILED: [code=1] libs/libGamedata/CMakeFiles/gamedata.dir/gameData/CampaignDescription.cpp.obj
S:\MSYS2\mingw64\bin\c++.exe -DBOOST_ALL_NO_LIB -DBOOST_FILESYSTEM_DYN_LINK=1 -DBOOST_FILESYSTEM_NO_LIB -DBOOST_LOCALE_DYN_LINK -DBOOST_LOCALE_NO_LIB -DBOOST_NOWIDE_DYN_LINK -DBOOST_NOWIDE_NO_LIB -DHAVE_STRUCT_TIMESPEC -DNOMINMAX -DUNICODE -DWIN32_LEAN_AND_MEAN -D_UNICODE -D__USE_W32_SOCKETS -ID:/github/s25client/libs/libGamedata -ID:/github/s25client/external/libutil/libs/common/include -ID:/github/s25client/external/libendian/include -ID:/github/s25client/external/mygettext/include -ID:/github/s25client/libs/common/include -ID:/github/s25client/external/libutil/libs/log/include -ID:/github/s25client/libs/rttrConfig/src -isystem D:/github/s25client/external/kaguya/include -O3 -DNDEBUG -fvisibility=hidden -fno-keep-inline-dllexport -mfpmath=sse -msse2 -Wall -pedantic -Wextra -Werror -fno-strict-aliasing -pedantic-errors -Wcast-qual -Wdisabled-optimization -Wfloat-conversion -Wformat-nonliteral -Wformat-security -Wformat=2 -Wimport -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-noreturn -Wpacked -Wparentheses -Wpedantic -Wpointer-arith -Wstrict-aliasing=2 -Wundef -Wunused -Wunused-parameter -Wwrite-strings -Wno-unknown-pragmas -Wctor-dtor-privacy -Woverloaded-virtual -Wstrict-null-sentinel -Wno-maybe-uninitialized -Wno-dangling-reference -Wsuggest-override -Wno-error=suggest-override -Wnoexcept -Wunreachable-code -MD -MT libs/libGamedata/CMakeFiles/gamedata.dir/gameData/CampaignDescription.cpp.obj -MF libs\libGamedata\CMakeFiles\gamedata.dir\gameData\CampaignDescription.cpp.obj.d -o libs/libGamedata/CMakeFiles/gamedata.dir/gameData/CampaignDescription.cpp.obj -c D:/github/s25client/libs/libGamedata/gameData/CampaignDescription.cpp
In file included from D:/github/s25client/external/kaguya/include/kaguya/error_handler.hpp:11,
                 from D:/github/s25client/external/kaguya/include/kaguya/lua_ref.hpp:16,
                 from D:/github/s25client/libs/libGamedata/gameData/SelectionMapInputData.h:6,
                 from D:/github/s25client/libs/libGamedata/gameData/CampaignDescription.h:6,
                 from D:/github/s25client/libs/libGamedata/gameData/CampaignDescription.cpp:5:
D:/github/s25client/external/kaguya/include/kaguya/type.hpp: In static member function 'static int kaguya::lua_type_traits<T, typename std::enable_if<std::is_enum<_Tp>::value>::type>::push(lua_State*, push_type)':
D:/github/s25client/external/kaguya/include/kaguya/type.hpp:561:49: error: 'int64_t' was not declared in this scope [-Wtemplate-body]
  561 |         l, static_cast<typename lua_type_traits<int64_t>::push_type>(s));
      |                                                 ^~~~~~~
D:/github/s25client/external/kaguya/include/kaguya/type.hpp:17:1: note: 'int64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
   16 | #include "kaguya/push_tuple.hpp"
  +++ |+#include <cstdint>
   17 |
D:/github/s25client/external/kaguya/include/kaguya/type.hpp:561:56: error: template argument 1 is invalid [-Wtemplate-body]
  561 |         l, static_cast<typename lua_type_traits<int64_t>::push_type>(s));
      |                                                        ^
ninja: build stopped: subcommand failed.

@Flamefire

Copy link
Copy Markdown
Member

I see. I have seen this before and fixed it in a PR that wasn't accepted so far.

@Flow86 If you can give me write access to our fork at https://github.com/Return-To-The-Roots/kaguya I'll add that commit there and switch the submodule to this fork instead. The upstream one seems to be abandoned

@yrrrmmbl That means you can remove that specific change and update your branch once that is done

@Flow86

Flow86 commented Sep 27, 2025

Copy link
Copy Markdown
Member

@Flamefire didnt knew you havent. I've added the appropriate group

Comment thread libs/common/include/helpers/win32_nanosleep.h
@Flamefire

Copy link
Copy Markdown
Member

#1802 does the update

@Flamefire
Flamefire merged commit 2d68497 into Return-To-The-Roots:master Oct 1, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants