From 1f825b47544157c19581925bf51c8bfc18627c38 Mon Sep 17 00:00:00 2001 From: Reece Date: Thu, 20 Jan 2022 13:27:45 +0000 Subject: [PATCH] [*] Update build script [*] Minor 32bit intrin fix [-] Remove pragma links --- Aurora.json | 2 +- Include/Aurora/Runtime.hpp | 2 +- Include/AuroraUtils.hpp | 4 ++-- Source/Debug/ExceptionWatcher.Win32.cpp | 2 -- Source/Locale/Encoding/Encoding.cpp | 4 ++-- Source/Parse/Parser.cpp | 4 ++-- 6 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Aurora.json b/Aurora.json index 97dfe17a..b4d73d3f 100644 --- a/Aurora.json +++ b/Aurora.json @@ -15,7 +15,7 @@ { "filter": {"platforms": "win32"}, "then": { - "links": ["Bcrypt.lib", "UxTheme.lib", "Aux_ulib.lib"] + "links": ["Bcrypt.lib", "UxTheme.lib", "Aux_ulib.lib", "Dbghelp.lib", "ws2_32.lib"] } } ] diff --git a/Include/Aurora/Runtime.hpp b/Include/Aurora/Runtime.hpp index ba130841..5e0528ab 100644 --- a/Include/Aurora/Runtime.hpp +++ b/Include/Aurora/Runtime.hpp @@ -49,7 +49,7 @@ #define AUKN_INTERFACE AUI_INTERFACE_IMPL #else #define AUKN_INTERFACE AUI_INTERFACE_FWD -#endif +#endif #include "Memory/Memory.hpp" diff --git a/Include/AuroraUtils.hpp b/Include/AuroraUtils.hpp index a377b01e..b443785f 100644 --- a/Include/AuroraUtils.hpp +++ b/Include/AuroraUtils.hpp @@ -701,7 +701,7 @@ static auline bool AuBitScanForward(AuUInt8 &index, T value) #if defined(AURORA_IS_32BIT) if (!_BitScanForward(&ret, static_cast(value & 0xffffffff))) { - _BitScanForward(&ret, static_cast((value << 32) & 0xffffffff)); + _BitScanForward(&ret, static_cast((value >> 32) & 0xffffffff)); ret += 32; } #else @@ -714,7 +714,7 @@ static auline bool AuBitScanForward(AuUInt8 &index, T value) auto lower = static_cast(value & 0xffffffff)); if (lower == 0) { - ret = __builtin_ctzl(static_cast((value << 32) & 0xffffffff)); + ret = __builtin_ctzl(static_cast((value >> 32) & 0xffffffff)); ret += 32; } else diff --git a/Source/Debug/ExceptionWatcher.Win32.cpp b/Source/Debug/ExceptionWatcher.Win32.cpp index 58b10ef8..9a0705f5 100644 --- a/Source/Debug/ExceptionWatcher.Win32.cpp +++ b/Source/Debug/ExceptionWatcher.Win32.cpp @@ -16,8 +16,6 @@ #include #include -#pragma comment(lib,"Dbghelp.lib") - #include #include diff --git a/Source/Locale/Encoding/Encoding.cpp b/Source/Locale/Encoding/Encoding.cpp index bab80cac..0c6e6648 100644 --- a/Source/Locale/Encoding/Encoding.cpp +++ b/Source/Locale/Encoding/Encoding.cpp @@ -14,7 +14,7 @@ namespace Aurora::Locale::Encoding AUKN_SYM BOM DecodeBOM(const Memory::MemoryViewRead & binary) { #define ADD_PATTERN(str, code) {str, {ECodePage::code, AuArraySize(str) - 1}} - AuList> bows = + AuList> bows = { ADD_PATTERN("\xFF\xFE\x00\x00", eUTF32), ADD_PATTERN("\x00\x00\xFE\xFF", eUTF32BE), @@ -33,7 +33,7 @@ namespace Aurora::Locale::Encoding for (const auto &[string, bom] : bows) { if (binary.length < bom.length) continue; - if (std::memcmp(binary.ptr, string, bom.length) != 0) continue; + if (AuMemcmp(binary.ptr, string, bom.length) != 0) continue; return bom; } diff --git a/Source/Parse/Parser.cpp b/Source/Parse/Parser.cpp index 1fe01853..708275e9 100644 --- a/Source/Parse/Parser.cpp +++ b/Source/Parse/Parser.cpp @@ -205,7 +205,7 @@ namespace Aurora::Parse } template - static bool ScrewExceptions_2(Func func, const std::string &in, Res &out) + static bool ScrewExceptions_2(Func func, const AuString &in, Res &out) { try { @@ -232,7 +232,7 @@ namespace Aurora::Parse auto itr = in.begin(); - if constexpr (std::is_same::value) + if constexpr (AuIsSame_v) { if (itr != in.end()) {