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:
matrix:
name:
- windows
<<<<<<< HEAD
- windows-xp
- windows-irrklang
- windows-no-dxsdk
=======
# - windows-irrklang
# - windows-no-dxsdk
>>>>>>> 6b5143bcae8d4534c3d47b16a820227dc56bb44f
- windows-x64
# - windows-2025
include:
......@@ -23,6 +28,7 @@ jobs:
os: windows-2022
vs: vs2022
audiolib: miniaudio
<<<<<<< HEAD
- name: windows-xp
os: windows-2019
vs: vs2019
......@@ -37,6 +43,17 @@ jobs:
vs: vs2022
audiolib: miniaudio
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
os: windows-2022
vs: vs2022
......@@ -44,7 +61,11 @@ jobs:
x64: true
# - name: windows-2025
# os: windows-2025
<<<<<<< HEAD
# vs: vs2022
=======
# vs: vs2025 # to be enabled after the release of Visual Studio 2025
>>>>>>> 6b5143bcae8d4534c3d47b16a820227dc56bb44f
# audiolib: miniaudio
runs-on: ${{ matrix.os }}
......@@ -88,7 +109,11 @@ jobs:
- name: Extract libevent
run: |
tar xf ${{ steps.libevent.outputs.filepath }}
<<<<<<< HEAD
move libevent-2.1.12-stable event
=======
move libevent-2.0.22-stable event
>>>>>>> 6b5143bcae8d4534c3d47b16a820227dc56bb44f
- name: Download freetype
id: freetype
......@@ -233,7 +258,11 @@ jobs:
- name: Use premake to generate Visual Studio solution
run: |
<<<<<<< HEAD
.\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
uses: microsoft/setup-msbuild@v2
......@@ -485,6 +514,7 @@ jobs:
matrix:
name:
- macos-13-intel
<<<<<<< HEAD
- macos-13-arm-cross-compile-static-link
- macos-13-universal-static-link
- macos-15-arm
......@@ -497,6 +527,20 @@ jobs:
os: macos-13
cross-build-arm: 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
os: macos-13
cross-build-intel: true
......@@ -504,6 +548,7 @@ jobs:
static-link: true
- name: macos-15-arm
os: macos-15
<<<<<<< HEAD
- name: macos-15-intel-cross-compile-static-link
os: macos-15
cross-build-intel: true
......@@ -513,6 +558,17 @@ jobs:
cross-build-intel: true
cross-build-arm: 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 }}
......
......@@ -13,7 +13,7 @@
#include <windows.h>
#include <ws2tcpip.h>
#ifdef _MSC_VER
#if defined(_MSC_VER) or defined(__MINGW32__)
#define mywcsncasecmp _wcsnicmp
#define mystrncasecmp _strnicmp
#else
......
......@@ -1323,7 +1323,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
case MSG_SELECT_DISFIELD: {
if (!(hovered_location & LOCATION_ONFIELD))
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 & selected_field) {
selected_field &= ~flag;
......
......@@ -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->setMaxSelectionRows(10);
cbAttribute->addItem(dataManager.GetSysString(1310), 0);
for(int filter = 0x1; filter != 0x80; filter <<= 1)
cbAttribute->addItem(dataManager.FormatAttribute(filter).c_str(), filter);
for (int filter = 0; filter < ATTRIBUTES_COUNT; ++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);
cbRace = env->addComboBox(irr::core::rect<irr::s32>(60, 40 + 75 / 6, 195, 60 + 75 / 6), wFilter, COMBOBOX_RACE);
cbRace->setMaxSelectionRows(10);
cbRace->addItem(dataManager.GetSysString(1310), 0);
for(int filter = 0x1; filter < (1 << RACES_COUNT); filter <<= 1)
cbRace->addItem(dataManager.FormatRace(filter).c_str(), filter);
for (int filter = 0; filter < RACES_COUNT; ++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);
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);
......
......@@ -532,9 +532,8 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
else{
curtime = temp_replay.pheader.seed;
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(L"\n");
}
std::wcsftime(infobuf, sizeof infobuf / sizeof infobuf[0], L"%Y/%m/%d %H:%M:%S\n", std::localtime(&curtime));
repinfo.append(infobuf);
......
......@@ -11,6 +11,10 @@ project "YGOPro"
includedirs { "../ocgcore" }
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
includedirs { "../event/include" }
else
......@@ -71,7 +75,7 @@ project "YGOPro"
entrypoint "mainCRTStartup"
defines { "_IRR_WCHAR_FILESYSTEM" }
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
links { "irrKlang" }
if IRRKLANG_PRO then
......@@ -84,10 +88,10 @@ project "YGOPro"
end
end
filter "not system:windows"
links { "dl", "pthread", "resolv" }
links { "resolv" }
filter "system:macosx"
openmp "Off"
links { "z" }
links { "OpenGL.framework", "Cocoa.framework", "IOKit.framework" }
defines { "GL_SILENCE_DEPRECATION" }
if MAC_ARM then
linkoptions { "-arch arm64" }
......@@ -98,6 +102,7 @@ project "YGOPro"
if USE_AUDIO and AUDIO_LIB == "irrklang" then
links { "irrklang" }
end
filter "system:linux"
linkoptions { "-static-libstdc++", "-static-libgcc" }
links { "GL", "X11", "Xxf86vm" }
......@@ -106,3 +111,6 @@ project "YGOPro"
links { "IrrKlang" }
linkoptions{ IRRKLANG_LINK_RPATH }
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() {
pheader.flag |= REPLAY_COMPRESSED;
size_t propsize = 5;
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) {
std::memcpy(comp_data, &ret, sizeof ret);
comp_size = sizeof ret;
......
......@@ -161,9 +161,6 @@ project "irrlicht"
defines { "NO_IRR_COMPILE_WITH_DIRECT3D_9_" }
end
filter { "system:linux" }
links { "X11", "Xxf86vm" }
filter { "system:macosx" }
cppdialect "gnu++14"
defines { "GL_SILENCE_DEPRECATION" }
......
......@@ -138,6 +138,3 @@ project "miniaudio"
includedirs { OPUS_INCLUDE_DIR, OPUSFILE_INCLUDE_DIR, VORBIS_INCLUDE_DIR, OGG_INCLUDE_DIR }
end
end
filter "system:linux"
links { "dl", "pthread", "m" }
......@@ -10,7 +10,9 @@ BUILD_LUA = true
LUA_LIB_NAME = "lua" -- change this if you don't build Lua
BUILD_EVENT = os.istarget("windows")
BUILD_FREETYPE = os.istarget("windows")
BUILD_SQLITE = os.istarget("windows")
BUILD_IRRLICHT = true -- modified Irrlicht is required, can't use the official one
USE_DXSDK = true
......@@ -378,6 +380,30 @@ if os.istarget("macosx") then
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"
location "build"
language "C++"
......@@ -423,7 +449,6 @@ workspace "YGOPro"
if MAC_ARM and MAC_INTEL then
architecture "universal"
end
links { "OpenGL.framework", "Cocoa.framework", "IOKit.framework" }
filter "system:linux"
buildoptions { "-U_FORTIFY_SOURCE" }
......@@ -459,7 +484,6 @@ workspace "YGOPro"
disablewarnings { "4244", "4267", "4838", "4996", "6011", "6031", "6054", "6262" }
filter { "configurations:Release", "not action:vs*" }
symbols "On"
defines "NDEBUG"
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