From f98f24f6fd349b5fa15a497d3524e7fd1bbf965d Mon Sep 17 00:00:00 2001 From: FutureRave Date: Wed, 26 Jan 2022 12:27:52 +0000 Subject: [PATCH] Upgrade further --- premake5.lua | 57 ++++++++++++---------------- src/Components/Modules/AntiCheat.cpp | 2 +- src/Components/Modules/Maps.cpp | 2 +- src/Utils/Utils.cpp | 4 +- 4 files changed, 29 insertions(+), 36 deletions(-) diff --git a/premake5.lua b/premake5.lua index e605dc71..a387f13f 100644 --- a/premake5.lua +++ b/premake5.lua @@ -250,29 +250,44 @@ workspace "iw4x" objdir "%{wks.location}/obj" targetdir "%{wks.location}/bin/%{cfg.buildcfg}" buildlog "%{wks.location}/obj/%{cfg.architecture}/%{cfg.buildcfg}/%{prj.name}/%{prj.name}.log" + configurations { "Debug", "Release" } + + language "C++" + cppdialect "C++17" + architecture "x86" - platforms "x86" + platforms "Win32" + + systemversion "latest" + symbols "On" staticruntime "On" + editandcontinue "Off" + warnings "Extra" + characterset "ASCII" + + flags { "NoIncrementalLink", "NoMinimalRebuild", "MultiProcessorCompile", "No64BitChecks" } + + filter "platforms:Win*" + defines {"_WINDOWS", "WIN32"} + filter {} filter "configurations:Release" - defines { "NDEBUG" } - flags { "MultiProcessorCompile", "LinkTimeOptimization", "No64BitChecks" } optimize "On" + buildoptions { "/GL" } + linkoptions { "/IGNORE:4702", "/LTCG" } + defines { "NDEBUG" } + flags { "FatalCompileWarnings", "FatalLinkWarnings" } if not _OPTIONS["force-unit-tests"] then rtti ("Off") end + filter {} filter "configurations:Debug" - defines { "DEBUG", "_DEBUG" } - flags { "MultiProcessorCompile", "No64BitChecks" } optimize "Debug" - if symbols ~= nil then - symbols "On" - else - flags { "Symbols" } - end + defines { "DEBUG", "_DEBUG" } + filter {} project "iw4x" kind "SharedLib" @@ -385,23 +400,6 @@ workspace "iw4x" } end - -- Specific configurations - flags { "UndefinedIdentifiers" } - warnings "Extra" - - if symbols ~= nil then - symbols "On" - else - flags { "Symbols" } - end - - filter "configurations:Release" - flags { - "FatalCompileWarnings", - "FatalLinkWarnings", - } - filter {} - --[[ -- Generate source code from protobuf definitions rules { "ProtobufCompiler" } @@ -445,11 +443,6 @@ workspace "iw4x" protobuf.project() zlib.project() udis86.project() - -workspace "*" - cppdialect "C++17" - defines { "_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS" } - defines { "_WINDOWS", "WIN32" } rule "ProtobufCompiler" display "Protobuf compiler" diff --git a/src/Components/Modules/AntiCheat.cpp b/src/Components/Modules/AntiCheat.cpp index af7b678d..01dbea5c 100644 --- a/src/Components/Modules/AntiCheat.cpp +++ b/src/Components/Modules/AntiCheat.cpp @@ -634,7 +634,7 @@ namespace Components LUID luid; TOKEN_PRIVILEGES tp = { 0 }; DWORD cb = sizeof(TOKEN_PRIVILEGES); - if (!LookupPrivilegeValueW(nullptr, SE_DEBUG_NAME, &luid)) return; + if (!LookupPrivilegeValueA(nullptr, SE_DEBUG_NAME, &luid)) return; tp.PrivilegeCount = 1; tp.Privileges[0].Luid = luid; diff --git a/src/Components/Modules/Maps.cpp b/src/Components/Modules/Maps.cpp index 97ec8f61..b18a8ce1 100644 --- a/src/Components/Modules/Maps.cpp +++ b/src/Components/Modules/Maps.cpp @@ -784,7 +784,7 @@ namespace Components { if (pack.index == dlc) { - ShellExecute(0, 0, L"https://xlabs.dev/support_iw4x_client.html", 0, 0, SW_SHOW); + ShellExecuteW(0, 0, L"https://xlabs.dev/support_iw4x_client.html", 0, 0, SW_SHOW); return; } } diff --git a/src/Utils/Utils.cpp b/src/Utils/Utils.cpp index 71d0af14..71445d52 100644 --- a/src/Utils/Utils.cpp +++ b/src/Utils/Utils.cpp @@ -107,12 +107,12 @@ namespace Utils void SetEnvironment() { wchar_t exeName[512]; - GetModuleFileName(GetModuleHandle(nullptr), exeName, sizeof(exeName) / 2); + GetModuleFileNameW(GetModuleHandle(nullptr), exeName, sizeof(exeName) / 2); wchar_t* exeBaseName = wcsrchr(exeName, L'\\'); exeBaseName[0] = L'\0'; - SetCurrentDirectory(exeName); + SetCurrentDirectoryW(exeName); } HMODULE GetNTDLL()