-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge 3.3.5-base_patch to 3.3.5-tele_npc_3
- Loading branch information
Showing
208 changed files
with
3,243 additions
and
1,330 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
version: 1.0.{build} | ||
image: Visual Studio 2019 | ||
image: Visual Studio 2022 | ||
clone_depth: 1 | ||
init: | ||
- ps: '' | ||
environment: | ||
BOOST_ROOT: C:\Libraries\boost_1_77_0 | ||
BOOST_ROOT: C:\Libraries\boost_1_73_0 | ||
OPENSSL_ROOT_DIR: C:\OpenSSL-v111-Win64 | ||
build_script: | ||
- cmd: >- | ||
git config user.email "[email protected]" && git config user.name "AppVeyor" | ||
md build && cd build | ||
cmake -G"Visual Studio 16 2019" -A x64 -DSCRIPTS=dynamic -DTOOLS=True -DCMAKE_CXX_FLAGS=" /DWIN32 /D_WINDOWS /W3 /GR /EHsc /WX" -DCMAKE_C_FLAGS="/DWIN32 /D_WINDOWS /W3 /WX" .. | ||
cmake -G"Visual Studio 17 2022" -A x64 -DSCRIPTS=dynamic -DTOOLS=True -DCMAKE_CXX_FLAGS=" /DWIN32 /D_WINDOWS /W3 /GR /EHsc /WX" -DCMAKE_C_FLAGS="/DWIN32 /D_WINDOWS /W3 /WX" .. | ||
"%programfiles(x86)%\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\amd64\MsBuild.exe" /nologo /m:2 /p:Configuration=RelWithDebInfo /p:Platform="X64" /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" "TrinityCore.sln" | ||
"C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe" /nologo /m:2 /p:Configuration=RelWithDebInfo /p:Platform="X64" /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" "TrinityCore.sln" | ||
cd bin\RelWithDebInfo\ | ||
|
@@ -26,16 +26,16 @@ build_script: | |
cd .. | ||
7z a TrinityCoreWin64VS2019.zip .\RelWithDebInfo\* | ||
7z a TrinityCoreWin64VS2022.zip .\RelWithDebInfo\* | ||
del /F /Q /S "RelWithDebInfo\*.pdb" > NUL | ||
7z a TrinityCoreWin64VS2019NoSymbols.zip .\RelWithDebInfo\* | ||
7z a TrinityCoreWin64VS2022NoSymbols.zip .\RelWithDebInfo\* | ||
test: off | ||
artifacts: | ||
- path: build\bin\TrinityCoreWin64VS2019.zip | ||
name: TrinityCoreWin64VS2019 | ||
- path: build\bin\TrinityCoreWin64VS2022.zip | ||
name: TrinityCoreWin64VS2022 | ||
|
||
- path: build\bin\TrinityCoreWin64VS2019NoSymbols.zip | ||
name: TrinityCoreWin64VS2019NoSymbols | ||
- path: build\bin\TrinityCoreWin64VS2022NoSymbols.zip | ||
name: TrinityCoreWin64VS2022NoSymbols |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
diff --git a/dep/g3dlite/include/G3D/Array.h b/dep/g3dlite/include/G3D/Array.h | ||
index c562f5c920f7..c86b20fd7e97 100644 | ||
--- a/dep/g3dlite/include/G3D/Array.h | ||
+++ b/dep/g3dlite/include/G3D/Array.h | ||
@@ -346,6 +346,7 @@ class Array { | ||
|
||
/** Resizes this to match the size of \a other and then copies the data from other using memcpy. This is only safe for POD types */ | ||
void copyPOD(const Array<T>& other) { | ||
+ static_assert(std::is_standard_layout_v<T> && std::is_trivial_v<T>, "copyPOD called on non-POD type"); | ||
if (numAllocated < other.num) { | ||
m_memoryManager->free(data); | ||
data = NULL; | ||
@@ -364,6 +365,7 @@ class Array { | ||
/** Resizes this to just barely match the size of \a other + itself and then copies the data to the end of the array from other using memcpy. | ||
This is only safe for POD types */ | ||
void appendPOD(const Array<T>& other) { | ||
+ static_assert(std::is_standard_layout_v<T> && std::is_trivial_v<T>, "appendPOD called on non-POD type"); | ||
const size_t oldSize = num; | ||
num += other.num; | ||
if (numAllocated < num) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/dep/g3dlite/source/fileutils.cpp b/dep/g3dlite/source/fileutils.cpp | ||
index 2788adad3bcd..f5310084cec7 100644 | ||
--- a/dep/g3dlite/source/fileutils.cpp | ||
+++ b/dep/g3dlite/source/fileutils.cpp | ||
@@ -490,7 +490,7 @@ void parseFilename( | ||
|
||
} | ||
|
||
- } else if ((f.size() >= 2) & isSlash(f[0]) && isSlash(f[1])) { | ||
+ } else if ((f.size() >= 2) && isSlash(f[0]) && isSlash(f[1])) { | ||
|
||
// e.g. //foo | ||
root = f.substr(0, 2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,192 @@ | ||
diff --git a/dep/g3dlite/include/G3D/AtomicInt32.h b/dep/g3dlite/include/G3D/AtomicInt32.h | ||
index 7b56e001ae29..9824d426d741 100644 | ||
--- a/dep/g3dlite/include/G3D/AtomicInt32.h | ||
+++ b/dep/g3dlite/include/G3D/AtomicInt32.h | ||
@@ -76,12 +76,16 @@ class AtomicInt32 { | ||
|
||
# elif defined(G3D_LINUX) || defined(G3D_FREEBSD) | ||
|
||
- int32 old; | ||
- asm volatile ("lock; xaddl %0,%1" | ||
- : "=r"(old), "=m"(m_value) /* outputs */ | ||
- : "0"(x), "m"(m_value) /* inputs */ | ||
- : "memory", "cc"); | ||
- return old; | ||
+# if defined(__aarch64__) | ||
+ return __sync_fetch_and_add(&m_value, x); | ||
+# else | ||
+ int32 old; | ||
+ asm volatile ("lock; xaddl %0,%1" | ||
+ : "=r"(old), "=m"(m_value) /* outputs */ | ||
+ : "0"(x), "m"(m_value) /* inputs */ | ||
+ : "memory", "cc"); | ||
+ return old; | ||
+# endif | ||
|
||
# elif defined(G3D_OSX) | ||
|
||
@@ -115,14 +119,18 @@ class AtomicInt32 { | ||
// Note: returns the newly decremented value | ||
return InterlockedDecrement(&m_value); | ||
# elif defined(G3D_LINUX) || defined(G3D_FREEBSD) | ||
- unsigned char nz; | ||
- | ||
- asm volatile ("lock; decl %1;\n\t" | ||
- "setnz %%al" | ||
- : "=a" (nz) | ||
- : "m" (m_value) | ||
- : "memory", "cc"); | ||
- return nz; | ||
+# if defined(__aarch64__) | ||
+ return __sync_sub_and_fetch(&m_value, 1); | ||
+# else | ||
+ unsigned char nz; | ||
+ | ||
+ asm volatile ("lock; decl %1;\n\t" | ||
+ "setnz %%al" | ||
+ : "=a" (nz) | ||
+ : "m" (m_value) | ||
+ : "memory", "cc"); | ||
+ return nz; | ||
+# endif | ||
# elif defined(G3D_OSX) | ||
// Note: returns the newly decremented value | ||
return OSAtomicDecrement32(&m_value); | ||
@@ -143,17 +151,21 @@ class AtomicInt32 { | ||
# if defined(G3D_WINDOWS) | ||
return InterlockedCompareExchange(&m_value, exchange, comperand); | ||
# elif defined(G3D_LINUX) || defined(G3D_FREEBSD) || defined(G3D_OSX) | ||
- // Based on Apache Portable Runtime | ||
- // http://koders.com/c/fid3B6631EE94542CDBAA03E822CA780CBA1B024822.aspx | ||
- int32 ret; | ||
- asm volatile ("lock; cmpxchgl %1, %2" | ||
- : "=a" (ret) | ||
- : "r" (exchange), "m" (m_value), "0"(comperand) | ||
- : "memory", "cc"); | ||
- return ret; | ||
- | ||
- // Note that OSAtomicCompareAndSwap32 does not return a useful value for us | ||
- // so it can't satisfy the cmpxchgl contract. | ||
+# if defined(__aarch64__) | ||
+ return __sync_val_compare_and_swap(&m_value, comperand, exchange); | ||
+# else | ||
+ // Based on Apache Portable Runtime | ||
+ // http://koders.com/c/fid3B6631EE94542CDBAA03E822CA780CBA1B024822.aspx | ||
+ int32 ret; | ||
+ asm volatile ("lock; cmpxchgl %1, %2" | ||
+ : "=a" (ret) | ||
+ : "r" (exchange), "m" (m_value), "0"(comperand) | ||
+ : "memory", "cc"); | ||
+ return ret; | ||
+ | ||
+ // Note that OSAtomicCompareAndSwap32 does not return a useful value for us | ||
+ // so it can't satisfy the cmpxchgl contract. | ||
+# endif | ||
# endif | ||
} | ||
|
||
diff --git a/dep/g3dlite/include/G3D/System.h b/dep/g3dlite/include/G3D/System.h | ||
index 4624dd916474..9ed88957d755 100644 | ||
--- a/dep/g3dlite/include/G3D/System.h | ||
+++ b/dep/g3dlite/include/G3D/System.h | ||
@@ -21,6 +21,10 @@ | ||
#include "G3D/FileNotFound.h" | ||
#include <string> | ||
|
||
+#if defined(__aarch64__) | ||
+#include <sys/time.h> | ||
+#endif | ||
+ | ||
#ifdef G3D_OSX | ||
#define Zone OSX_Zone | ||
# include <CoreServices/CoreServices.h> | ||
@@ -497,15 +501,37 @@ class System { | ||
#elif defined(G3D_LINUX) | ||
|
||
inline uint64 System::getCycleCount() { | ||
- uint32 timehi, timelo; | ||
+# if defined(__aarch64__) | ||
+# if (__ARM_ARCH >= 6) // V6 is the earliest arch that has a standard cyclecount | ||
+ uint32_t pmccntr; | ||
+ uint32_t pmuseren; | ||
+ uint32_t pmcntenset; | ||
+ // Read the user mode perf monitor counter access permissions. | ||
+ __asm__ __volatile__("mrc p15, 0, %w0, c9, c14, 0" : "=r"(pmuseren)); | ||
+ if (pmuseren & 1) { // Allows reading perfmon counters for user mode code. | ||
+ __asm__ __volatile__("mrc p15, 0, %w0, c9, c12, 1" : "=r"(pmcntenset)); | ||
+ if (pmcntenset & 0x80000000ul) { // Is it counting? | ||
+ __asm__ __volatile__("mrc p15, 0, %w0, c9, c13, 0" : "=r"(pmccntr)); | ||
+ // The counter is set up to count every 64th cycle | ||
+ return static_cast<uint64>(pmccntr) * 64; // Should optimize to << 6 | ||
+ } | ||
+ } | ||
+# endif | ||
|
||
- __asm__ __volatile__ ( | ||
- "rdtsc " | ||
- : "=a" (timelo), | ||
- "=d" (timehi) | ||
- : ); | ||
+ struct timeval tv; | ||
+ gettimeofday(&tv, nullptr); | ||
+ return static_cast<uint64>(tv.tv_sec) * 1000000 + tv.tv_usec; | ||
+# else | ||
+ uint32 timehi, timelo; | ||
+ | ||
+ __asm__ __volatile__ ( | ||
+ "rdtsc " | ||
+ : "=a" (timelo), | ||
+ "=d" (timehi) | ||
+ : ); | ||
|
||
- return ((uint64)timehi << 32) + (uint64)timelo; | ||
+ return ((uint64)timehi << 32) + (uint64)timelo; | ||
+# endif | ||
} | ||
|
||
#elif defined(G3D_OSX) | ||
diff --git a/dep/g3dlite/include/G3D/platform.h b/dep/g3dlite/include/G3D/platform.h | ||
index 439495ab1315..d043f21491ad 100644 | ||
--- a/dep/g3dlite/include/G3D/platform.h | ||
+++ b/dep/g3dlite/include/G3D/platform.h | ||
@@ -273,7 +273,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw) {\ | ||
# define __stdcall __attribute__((stdcall)) | ||
# endif | ||
|
||
-# elif defined(__x86_64__) | ||
+# elif defined(__x86_64__) || defined(__arm) || defined(__aarch64__) | ||
|
||
# ifndef __cdecl | ||
# define __cdecl | ||
diff --git a/dep/g3dlite/source/System.cpp b/dep/g3dlite/source/System.cpp | ||
index b841e23c497e..4a75d320b8d3 100644 | ||
--- a/dep/g3dlite/source/System.cpp | ||
+++ b/dep/g3dlite/source/System.cpp | ||
@@ -79,8 +79,9 @@ | ||
#endif | ||
|
||
// SIMM include | ||
+#if !defined(__aarch64__) | ||
#include <xmmintrin.h> | ||
- | ||
+#endif | ||
|
||
namespace G3D { | ||
|
||
@@ -1697,6 +1698,16 @@ void System::cpuid(CPUIDFunction func, uint32& eax, uint32& ebx, uint32& ecx, ui | ||
edx = regs[3]; | ||
} | ||
|
||
+#elif defined(__aarch64__) || defined(G3D_OSX) && ! defined(G3D_OSX_INTEL) | ||
+ | ||
+// non-x86 CPU; no CPUID | ||
+void System::cpuid(CPUIDFunction func, uint32& eax, uint32& ebx, uint32& ecx, uint32& edx) { | ||
+ eax = 0; | ||
+ ebx = 0; | ||
+ ecx = 0; | ||
+ edx = 0; | ||
+} | ||
+ | ||
#else | ||
|
||
// See http://sam.zoy.org/blog/2007-04-13-shlib-with-non-pic-code-have-inline-assembly-and-pic-mix-well |
Oops, something went wrong.