Commit 4d68b939 authored by nanahira's avatar nanahira

Merge branch 'patch-glibc-dl' of ../versions/ygopro-fh into develop

parents 8d525d68 6b5143bc
...@@ -13,9 +13,14 @@ jobs: ...@@ -13,9 +13,14 @@ jobs:
matrix: matrix:
name: name:
- windows - windows
<<<<<<< HEAD
- windows-xp - windows-xp
- windows-irrklang - windows-irrklang
- windows-no-dxsdk - windows-no-dxsdk
=======
# - windows-irrklang
# - windows-no-dxsdk
>>>>>>> 6b5143bcae8d4534c3d47b16a820227dc56bb44f
- windows-x64 - windows-x64
# - windows-2025 # - windows-2025
include: include:
...@@ -23,6 +28,7 @@ jobs: ...@@ -23,6 +28,7 @@ jobs:
os: windows-2022 os: windows-2022
vs: vs2022 vs: vs2022
audiolib: miniaudio audiolib: miniaudio
<<<<<<< HEAD
- name: windows-xp - name: windows-xp
os: windows-2019 os: windows-2019
vs: vs2019 vs: vs2019
...@@ -37,6 +43,17 @@ jobs: ...@@ -37,6 +43,17 @@ jobs:
vs: vs2022 vs: vs2022
audiolib: miniaudio audiolib: miniaudio
nodxsdk: true nodxsdk: true
=======
# - name: windows-irrklang
# os: windows-2022
# vs: vs2022
# audiolib: irrklang
# - name: windows-no-dxsdk
# os: windows-2022
# vs: vs2022
# audiolib: miniaudio
# nodxsdk: true
>>>>>>> 6b5143bcae8d4534c3d47b16a820227dc56bb44f
- name: windows-x64 - name: windows-x64
os: windows-2022 os: windows-2022
vs: vs2022 vs: vs2022
...@@ -44,7 +61,11 @@ jobs: ...@@ -44,7 +61,11 @@ jobs:
x64: true x64: true
# - name: windows-2025 # - name: windows-2025
# os: windows-2025 # os: windows-2025
<<<<<<< HEAD
# vs: vs2022 # vs: vs2022
=======
# vs: vs2025 # to be enabled after the release of Visual Studio 2025
>>>>>>> 6b5143bcae8d4534c3d47b16a820227dc56bb44f
# audiolib: miniaudio # audiolib: miniaudio
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
...@@ -88,7 +109,11 @@ jobs: ...@@ -88,7 +109,11 @@ jobs:
- name: Extract libevent - name: Extract libevent
run: | run: |
tar xf ${{ steps.libevent.outputs.filepath }} tar xf ${{ steps.libevent.outputs.filepath }}
<<<<<<< HEAD
move libevent-2.1.12-stable event move libevent-2.1.12-stable event
=======
move libevent-2.0.22-stable event
>>>>>>> 6b5143bcae8d4534c3d47b16a820227dc56bb44f
- name: Download freetype - name: Download freetype
id: freetype id: freetype
...@@ -233,7 +258,11 @@ jobs: ...@@ -233,7 +258,11 @@ jobs:
- name: Use premake to generate Visual Studio solution - name: Use premake to generate Visual Studio solution
run: | run: |
<<<<<<< HEAD
.\premake5.exe ${{ matrix.vs }} --audio-lib=${{ matrix.audiolib }} ${{ matrix.xp && '--winxp-support' || '' }} .\premake5.exe ${{ matrix.vs }} --audio-lib=${{ matrix.audiolib }} ${{ matrix.xp && '--winxp-support' || '' }}
=======
.\premake5.exe ${{ matrix.vs }} --audio-lib=${{ matrix.audiolib }}
>>>>>>> 6b5143bcae8d4534c3d47b16a820227dc56bb44f
- name: Add msbuild to PATH - name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2 uses: microsoft/setup-msbuild@v2
...@@ -485,6 +514,7 @@ jobs: ...@@ -485,6 +514,7 @@ jobs:
matrix: matrix:
name: name:
- macos-13-intel - macos-13-intel
<<<<<<< HEAD
- macos-13-arm-cross-compile-static-link - macos-13-arm-cross-compile-static-link
- macos-13-universal-static-link - macos-13-universal-static-link
- macos-15-arm - macos-15-arm
...@@ -497,6 +527,20 @@ jobs: ...@@ -497,6 +527,20 @@ jobs:
os: macos-13 os: macos-13
cross-build-arm: true cross-build-arm: true
static-link: true static-link: true
=======
# - macos-13-arm-cross-compile-static-link
- macos-13-universal-static-link
- macos-15-arm
# - macos-15-intel-cross-compile-static-link
# - macos-15-universal-static-link
include:
- name: macos-13-intel
os: macos-13
# - name: macos-13-arm-cross-compile-static-link
# os: macos-13
# cross-build-arm: true
# static-link: true
>>>>>>> 6b5143bcae8d4534c3d47b16a820227dc56bb44f
- name: macos-13-universal-static-link - name: macos-13-universal-static-link
os: macos-13 os: macos-13
cross-build-intel: true cross-build-intel: true
...@@ -504,6 +548,7 @@ jobs: ...@@ -504,6 +548,7 @@ jobs:
static-link: true static-link: true
- name: macos-15-arm - name: macos-15-arm
os: macos-15 os: macos-15
<<<<<<< HEAD
- name: macos-15-intel-cross-compile-static-link - name: macos-15-intel-cross-compile-static-link
os: macos-15 os: macos-15
cross-build-intel: true cross-build-intel: true
...@@ -513,6 +558,17 @@ jobs: ...@@ -513,6 +558,17 @@ jobs:
cross-build-intel: true cross-build-intel: true
cross-build-arm: true cross-build-arm: true
static-link: true static-link: true
=======
# - name: macos-15-intel-cross-compile-static-link
# os: macos-15
# cross-build-intel: true
# static-link: true
# - name: macos-15-universal-static-link
# os: macos-15
# cross-build-intel: true
# cross-build-arm: true
# static-link: true
>>>>>>> 6b5143bcae8d4534c3d47b16a820227dc56bb44f
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <windows.h> #include <windows.h>
#include <ws2tcpip.h> #include <ws2tcpip.h>
#ifdef _MSC_VER #if defined(_MSC_VER) or defined(__MINGW32__)
#define mywcsncasecmp _wcsnicmp #define mywcsncasecmp _wcsnicmp
#define mystrncasecmp _strnicmp #define mystrncasecmp _strnicmp
#else #else
......
...@@ -1323,7 +1323,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -1323,7 +1323,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
case MSG_SELECT_DISFIELD: { case MSG_SELECT_DISFIELD: {
if (!(hovered_location & LOCATION_ONFIELD)) if (!(hovered_location & LOCATION_ONFIELD))
break; break;
unsigned int flag = 1 << (hovered_sequence + (hovered_controler << 4) + ((hovered_location == LOCATION_MZONE) ? 0 : 8)); unsigned int flag = 0x1U << (hovered_sequence + (hovered_controler << 4) + ((hovered_location == LOCATION_MZONE) ? 0 : 8));
if (flag & selectable_field) { if (flag & selectable_field) {
if (flag & selected_field) { if (flag & selected_field) {
selected_field &= ~flag; selected_field &= ~flag;
......
...@@ -813,14 +813,14 @@ bool Game::Initialize() { ...@@ -813,14 +813,14 @@ bool Game::Initialize() {
cbAttribute = env->addComboBox(irr::core::rect<irr::s32>(60, 20 + 50 / 6, 195, 40 + 50 / 6), wFilter, COMBOBOX_ATTRIBUTE); cbAttribute = env->addComboBox(irr::core::rect<irr::s32>(60, 20 + 50 / 6, 195, 40 + 50 / 6), wFilter, COMBOBOX_ATTRIBUTE);
cbAttribute->setMaxSelectionRows(10); cbAttribute->setMaxSelectionRows(10);
cbAttribute->addItem(dataManager.GetSysString(1310), 0); cbAttribute->addItem(dataManager.GetSysString(1310), 0);
for(int filter = 0x1; filter != 0x80; filter <<= 1) for (int filter = 0; filter < ATTRIBUTES_COUNT; ++filter)
cbAttribute->addItem(dataManager.FormatAttribute(filter).c_str(), filter); cbAttribute->addItem(dataManager.FormatAttribute(0x1U << filter).c_str(), 0x1U << filter);
stRace = env->addStaticText(dataManager.GetSysString(1321), irr::core::rect<irr::s32>(10, 42 + 75 / 6, 70, 62 + 75 / 6), false, false, wFilter); stRace = env->addStaticText(dataManager.GetSysString(1321), irr::core::rect<irr::s32>(10, 42 + 75 / 6, 70, 62 + 75 / 6), false, false, wFilter);
cbRace = env->addComboBox(irr::core::rect<irr::s32>(60, 40 + 75 / 6, 195, 60 + 75 / 6), wFilter, COMBOBOX_RACE); cbRace = env->addComboBox(irr::core::rect<irr::s32>(60, 40 + 75 / 6, 195, 60 + 75 / 6), wFilter, COMBOBOX_RACE);
cbRace->setMaxSelectionRows(10); cbRace->setMaxSelectionRows(10);
cbRace->addItem(dataManager.GetSysString(1310), 0); cbRace->addItem(dataManager.GetSysString(1310), 0);
for(int filter = 0x1; filter < (1 << RACES_COUNT); filter <<= 1) for (int filter = 0; filter < RACES_COUNT; ++filter)
cbRace->addItem(dataManager.FormatRace(filter).c_str(), filter); cbRace->addItem(dataManager.FormatRace(0x1U << filter).c_str(), 0x1U << filter);
stAttack = env->addStaticText(dataManager.GetSysString(1322), irr::core::rect<irr::s32>(205, 22 + 50 / 6, 280, 42 + 50 / 6), false, false, wFilter); stAttack = env->addStaticText(dataManager.GetSysString(1322), irr::core::rect<irr::s32>(205, 22 + 50 / 6, 280, 42 + 50 / 6), false, false, wFilter);
ebAttack = env->addEditBox(L"", irr::core::rect<irr::s32>(260, 20 + 50 / 6, 340, 40 + 50 / 6), true, wFilter, EDITBOX_INPUTS); ebAttack = env->addEditBox(L"", irr::core::rect<irr::s32>(260, 20 + 50 / 6, 340, 40 + 50 / 6), true, wFilter, EDITBOX_INPUTS);
ebAttack->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER); ebAttack->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
......
...@@ -532,9 +532,8 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) { ...@@ -532,9 +532,8 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
else{ else{
curtime = temp_replay.pheader.seed; curtime = temp_replay.pheader.seed;
wchar_t version_info[256]{}; wchar_t version_info[256]{};
myswprintf(version_info, L"version 0x%X", temp_replay.pheader.version); myswprintf(version_info, L"version 0x%X\n", temp_replay.pheader.version);
repinfo.append(version_info); repinfo.append(version_info);
repinfo.append(L"\n");
} }
std::wcsftime(infobuf, sizeof infobuf / sizeof infobuf[0], L"%Y/%m/%d %H:%M:%S\n", std::localtime(&curtime)); std::wcsftime(infobuf, sizeof infobuf / sizeof infobuf[0], L"%Y/%m/%d %H:%M:%S\n", std::localtime(&curtime));
repinfo.append(infobuf); repinfo.append(infobuf);
......
...@@ -11,6 +11,10 @@ project "YGOPro" ...@@ -11,6 +11,10 @@ project "YGOPro"
includedirs { "../ocgcore" } includedirs { "../ocgcore" }
links { "ocgcore", "clzma", "cspmemvfs", LUA_LIB_NAME, "sqlite3", "irrlicht", "freetype", "event" } links { "ocgcore", "clzma", "cspmemvfs", LUA_LIB_NAME, "sqlite3", "irrlicht", "freetype", "event" }
if not BUILD_LUA then
libdirs { LUA_LIB_DIR }
end
if BUILD_EVENT then if BUILD_EVENT then
includedirs { "../event/include" } includedirs { "../event/include" }
else else
...@@ -71,7 +75,7 @@ project "YGOPro" ...@@ -71,7 +75,7 @@ project "YGOPro"
entrypoint "mainCRTStartup" entrypoint "mainCRTStartup"
defines { "_IRR_WCHAR_FILESYSTEM" } defines { "_IRR_WCHAR_FILESYSTEM" }
files "ygopro.rc" files "ygopro.rc"
links { "opengl32", "ws2_32", "winmm", "gdi32", "kernel32", "user32", "imm32", "Dnsapi", "iphlpapi" } links { "ws2_32", "Dnsapi", "iphlpapi" }
if USE_AUDIO and AUDIO_LIB == "irrklang" then if USE_AUDIO and AUDIO_LIB == "irrklang" then
links { "irrKlang" } links { "irrKlang" }
if IRRKLANG_PRO then if IRRKLANG_PRO then
...@@ -84,10 +88,10 @@ project "YGOPro" ...@@ -84,10 +88,10 @@ project "YGOPro"
end end
end end
filter "not system:windows" filter "not system:windows"
links { "dl", "pthread", "resolv" } links { "resolv" }
filter "system:macosx" filter "system:macosx"
openmp "Off" openmp "Off"
links { "z" } links { "OpenGL.framework", "Cocoa.framework", "IOKit.framework" }
defines { "GL_SILENCE_DEPRECATION" } defines { "GL_SILENCE_DEPRECATION" }
if MAC_ARM then if MAC_ARM then
linkoptions { "-arch arm64" } linkoptions { "-arch arm64" }
...@@ -98,6 +102,7 @@ project "YGOPro" ...@@ -98,6 +102,7 @@ project "YGOPro"
if USE_AUDIO and AUDIO_LIB == "irrklang" then if USE_AUDIO and AUDIO_LIB == "irrklang" then
links { "irrklang" } links { "irrklang" }
end end
filter "system:linux" filter "system:linux"
linkoptions { "-static-libstdc++", "-static-libgcc" } linkoptions { "-static-libstdc++", "-static-libgcc" }
links { "GL", "X11", "Xxf86vm" } links { "GL", "X11", "Xxf86vm" }
...@@ -106,3 +111,6 @@ project "YGOPro" ...@@ -106,3 +111,6 @@ project "YGOPro"
links { "IrrKlang" } links { "IrrKlang" }
linkoptions{ IRRKLANG_LINK_RPATH } linkoptions{ IRRKLANG_LINK_RPATH }
end end
if GLIBC_VERSION < ((2 << 16) | (34 << 8)) then -- glibc less than 2.34
links { "dl", "pthread" }
end
...@@ -81,7 +81,7 @@ void Replay::EndRecord() { ...@@ -81,7 +81,7 @@ void Replay::EndRecord() {
pheader.flag |= REPLAY_COMPRESSED; pheader.flag |= REPLAY_COMPRESSED;
size_t propsize = 5; size_t propsize = 5;
comp_size = MAX_COMP_SIZE; comp_size = MAX_COMP_SIZE;
int ret = LzmaCompress(comp_data, &comp_size, replay_data, replay_size, pheader.props, &propsize, 5, 1 << 24, 3, 0, 2, 32, 1); int ret = LzmaCompress(comp_data, &comp_size, replay_data, replay_size, pheader.props, &propsize, 5, 0x1U << 24, 3, 0, 2, 32, 1);
if (ret != SZ_OK) { if (ret != SZ_OK) {
std::memcpy(comp_data, &ret, sizeof ret); std::memcpy(comp_data, &ret, sizeof ret);
comp_size = sizeof ret; comp_size = sizeof ret;
......
...@@ -161,9 +161,6 @@ project "irrlicht" ...@@ -161,9 +161,6 @@ project "irrlicht"
defines { "NO_IRR_COMPILE_WITH_DIRECT3D_9_" } defines { "NO_IRR_COMPILE_WITH_DIRECT3D_9_" }
end end
filter { "system:linux" }
links { "X11", "Xxf86vm" }
filter { "system:macosx" } filter { "system:macosx" }
cppdialect "gnu++14" cppdialect "gnu++14"
defines { "GL_SILENCE_DEPRECATION" } defines { "GL_SILENCE_DEPRECATION" }
......
...@@ -138,6 +138,3 @@ project "miniaudio" ...@@ -138,6 +138,3 @@ project "miniaudio"
includedirs { OPUS_INCLUDE_DIR, OPUSFILE_INCLUDE_DIR, VORBIS_INCLUDE_DIR, OGG_INCLUDE_DIR } includedirs { OPUS_INCLUDE_DIR, OPUSFILE_INCLUDE_DIR, VORBIS_INCLUDE_DIR, OGG_INCLUDE_DIR }
end end
end end
filter "system:linux"
links { "dl", "pthread", "m" }
...@@ -10,7 +10,9 @@ BUILD_LUA = true ...@@ -10,7 +10,9 @@ BUILD_LUA = true
LUA_LIB_NAME = "lua" -- change this if you don't build Lua LUA_LIB_NAME = "lua" -- change this if you don't build Lua
BUILD_EVENT = os.istarget("windows") BUILD_EVENT = os.istarget("windows")
BUILD_FREETYPE = os.istarget("windows") BUILD_FREETYPE = os.istarget("windows")
BUILD_SQLITE = os.istarget("windows") BUILD_SQLITE = os.istarget("windows")
BUILD_IRRLICHT = true -- modified Irrlicht is required, can't use the official one BUILD_IRRLICHT = true -- modified Irrlicht is required, can't use the official one
USE_DXSDK = true USE_DXSDK = true
...@@ -378,6 +380,30 @@ if os.istarget("macosx") then ...@@ -378,6 +380,30 @@ if os.istarget("macosx") then
end end
end end
function getGlibcVersion()
local output = os.outputof("getconf GNU_LIBC_VERSION")
local major, minor, patch = output:match("glibc (%d+)%.(%d+)%.?(%d*)")
if major and minor then
major = tonumber(major)
minor = tonumber(minor)
patch = tonumber(patch) or 0
return (major << 16) | (minor << 8) | patch
end
return nil
end
GLIBC_VERSION=0
if os.ishost("linux") then
GLIBC_VERSION = getGlibcVersion()
if GLIBC_VERSION>0 then
print("Detected glibc version: " .. string.format("%d.%d.%d", GLIBC_VERSION >> 16, (GLIBC_VERSION >> 8) & 0xFF, GLIBC_VERSION & 0xFF))
else
print("Could not detect glibc version, assuming it is sufficient.")
end
end
workspace "YGOPro" workspace "YGOPro"
location "build" location "build"
language "C++" language "C++"
...@@ -423,7 +449,6 @@ workspace "YGOPro" ...@@ -423,7 +449,6 @@ workspace "YGOPro"
if MAC_ARM and MAC_INTEL then if MAC_ARM and MAC_INTEL then
architecture "universal" architecture "universal"
end end
links { "OpenGL.framework", "Cocoa.framework", "IOKit.framework" }
filter "system:linux" filter "system:linux"
buildoptions { "-U_FORTIFY_SOURCE" } buildoptions { "-U_FORTIFY_SOURCE" }
...@@ -459,7 +484,6 @@ workspace "YGOPro" ...@@ -459,7 +484,6 @@ workspace "YGOPro"
disablewarnings { "4244", "4267", "4838", "4996", "6011", "6031", "6054", "6262" } disablewarnings { "4244", "4267", "4838", "4996", "6011", "6031", "6054", "6262" }
filter { "configurations:Release", "not action:vs*" } filter { "configurations:Release", "not action:vs*" }
symbols "On"
defines "NDEBUG" defines "NDEBUG"
filter { "configurations:Debug", "action:vs*" } filter { "configurations:Debug", "action:vs*" }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment