Skip to content

Commit b9f9c8e

Browse files
committed
2 parents ded54fd + cbb2b40 commit b9f9c8e

489 files changed

Lines changed: 2693 additions & 55912 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Core/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ target_link_libraries(corei_always INTERFACE
1616

1717
# Do we want to build extra SDK stuff or just the game binary?
1818
option(RTS_BUILD_CORE_TOOLS "Build core tools" ON)
19-
add_feature_info(CoreTools GENZH_BUILD_ZEROHOUR_TOOLS "Build Core Mod Tools")
19+
add_feature_info(CoreTools RTS_BUILD_CORE_TOOLS "Build Core Mod Tools")
2020
option(RTS_BUILD_CORE_EXTRAS "Build core extra tools/tests" OFF)
21-
add_feature_info(CoreExtras GENZH_BUILD_ZEROHOUR_EXTRAS "Build Core Extra Tools/Tests")
21+
add_feature_info(CoreExtras RTS_BUILD_CORE_EXTRAS "Build Core Extra Tools/Tests")
2222

2323
# Set where the build results will end up
2424
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

Core/Libraries/Include/Lib/BaseTypeCore.h

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
// TheSuperHackers @compile feliwir 07/04/2025 Adds utility macros for cross-platform compatibility
3838
#include <Utility/compat.h>
3939
#include <Utility/CppMacros.h>
40+
#include <Utility/stdint_adapter.h>
4041

4142
/*
4243
** Turn off some unneeded warnings.
@@ -124,22 +125,17 @@
124125
//--------------------------------------------------------------------
125126
// Fundamental type definitions
126127
//--------------------------------------------------------------------
127-
typedef float Real; // 4 bytes
128-
typedef int Int; // 4 bytes
129-
typedef unsigned int UnsignedInt; // 4 bytes
130-
typedef unsigned short UnsignedShort; // 2 bytes
131-
typedef short Short; // 2 bytes
132-
typedef unsigned char UnsignedByte; // 1 byte USED TO BE "Byte"
133-
typedef char Byte; // 1 byte USED TO BE "SignedByte"
134-
typedef char Char; // 1 byte of text
135-
typedef bool Bool; //
128+
typedef float Real; // 4 bytes
129+
typedef int32_t Int; // 4 bytes
130+
typedef uint32_t UnsignedInt; // 4 bytes
131+
typedef uint16_t UnsignedShort; // 2 bytes
132+
typedef int16_t Short; // 2 bytes
133+
typedef unsigned char UnsignedByte; // 1 byte USED TO BE "Byte"
134+
typedef char Byte; // 1 byte USED TO BE "SignedByte"
135+
typedef char Char; // 1 byte of text
136+
typedef bool Bool; //
136137
// note, the types below should use "long long", but MSVC doesn't support it yet
137-
#ifdef _MSC_VER
138-
typedef __int64 Int64; // 8 bytes
139-
typedef unsigned __int64 UnsignedInt64; // 8 bytes
140-
#else
141-
typedef long long Int64; // 8 bytes
142-
typedef unsigned long long UnsignedInt64; // 8 bytes
143-
#endif
138+
typedef int64_t Int64; // 8 bytes
139+
typedef uint64_t UnsignedInt64; // 8 bytes
144140

145141
#endif // _BASE_TYPE_CORE_H_

Core/Libraries/Source/WWVegas/WWDebug/wwdebug.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343

4444

4545
#include "wwdebug.h"
46-
#include <windows.h>
4746
//#include "win.h" can use this if allowed to see wwlib
4847
#include <stdlib.h>
4948
#include <stdarg.h>
@@ -53,6 +52,11 @@
5352
#include <signal.h>
5453
#include "Except.h"
5554

55+
#ifdef _WIN32
56+
#include <windows.h>
57+
#else
58+
#include <errno.h>
59+
#endif
5660

5761
static PrintFunc _CurMessageHandler = NULL;
5862
static AssertPrintFunc _CurAssertHandler = NULL;
@@ -79,7 +83,11 @@ void Convert_System_Error_To_String(int id, char* buffer, int buf_len)
7983

8084
int Get_Last_System_Error()
8185
{
86+
#ifdef _WIN32
8287
return GetLastError();
88+
#else
89+
return errno;
90+
#endif
8391
}
8492

8593
/***********************************************************************************************

Core/Libraries/Source/WWVegas/WWDebug/wwmemlog.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
#include "wwdebug.h"
4444
#include "Vector.H"
4545
#include "FastAllocator.h"
46-
#include <windows.h>
4746

4847
#define USE_FAST_ALLOCATOR
4948

@@ -70,7 +69,8 @@
7069
** Enable one of the following #defines to specify which thread-sychronization
7170
** method to use.
7271
*/
73-
#ifndef _UNIX
72+
#ifdef _WIN32
73+
#include <windows.h>
7474
#define MEMLOG_USE_MUTEX 0
7575
#define MEMLOG_USE_CRITICALSECTION 1
7676
#define MEMLOG_USE_FASTCRITICALSECTION 0
@@ -289,6 +289,10 @@ WWINLINE void * Get_Mem_Log_Mutex(void)
289289
return _MemLogCriticalSectionHandle;
290290

291291
#endif
292+
293+
#if DISABLE_MEMLOG
294+
return NULL;
295+
#endif
292296
}
293297

294298
WWINLINE void Lock_Mem_Log_Mutex(void)

Core/Libraries/Source/WWVegas/WWDebug/wwprofile.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
#include "wwprofile.h"
5454
#include "FastAllocator.h"
5555
#include "wwdebug.h"
56-
#include <windows.h>
5756
//#include "systimer.h"
5857
#include "systimer.h"
5958
#include "RAWFILE.H"

Core/Libraries/Source/WWVegas/WWLib/Vector.H

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ template<class T>
317317
inline int VectorClass<T>::ID(T const * ptr)
318318
{
319319
if (!IsValid) return(0);
320-
return(((unsigned long)ptr - (unsigned long)&(*this)[0]) / sizeof(T));
320+
return(((uintptr_t)ptr - (uintptr_t)&(*this)[0]) / sizeof(T));
321321
}
322322

323323

Core/Libraries/Source/WWVegas/WWLib/always.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545

4646
// TheSuperHackers @compile feliwir 17/04/2025 include utility macros for cross-platform compatibility
4747
#include <Utility/compat.h>
48+
#include <Utility/stdint_adapter.h>
4849

4950
// Disable warning about exception handling not being enabled. It's used as part of STL - in a part of STL we don't use.
5051
#pragma warning(disable : 4530)

Core/Libraries/Source/WWVegas/WWLib/wwstring.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ StringClass::Get_String (int length, bool is_temp)
101101
//
102102
// Grab this unused buffer for our string
103103
//
104-
unsigned long temp_string=reinterpret_cast<unsigned long>(m_TempStrings);
104+
uintptr_t temp_string=reinterpret_cast<uintptr_t>(m_TempStrings);
105105
temp_string+=MAX_TEMP_BYTES*MAX_TEMP_STRING;
106106
temp_string&=~(MAX_TEMP_BYTES*MAX_TEMP_STRING-1);
107107
temp_string+=index*MAX_TEMP_BYTES;
@@ -196,8 +196,8 @@ StringClass::Free_String (void)
196196
{
197197
if (m_Buffer != m_EmptyString) {
198198

199-
unsigned long buffer_base=reinterpret_cast<unsigned long>(m_Buffer-sizeof (StringClass::_HEADER));
200-
unsigned long temp_base=reinterpret_cast<unsigned long>(m_TempStrings+MAX_TEMP_BYTES*MAX_TEMP_STRING);
199+
uintptr_t buffer_base=reinterpret_cast<uintptr_t>(m_Buffer-sizeof (StringClass::_HEADER));
200+
uintptr_t temp_base=reinterpret_cast<uintptr_t>(m_TempStrings+MAX_TEMP_BYTES*MAX_TEMP_STRING);
201201

202202
if ((buffer_base>>11)==(temp_base>>11)) {
203203
m_Buffer[0] = 0;

0 commit comments

Comments
 (0)