Skip to content

Commit 03f4f73

Browse files
committed
Merge branch 'main' into headless_sh
# Conflicts: # GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainVisual.cpp
2 parents e50eec4 + 3d4b5c7 commit 03f4f73

File tree

888 files changed

+2236
-124940
lines changed

Some content is hidden

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

888 files changed

+2236
-124940
lines changed

Core/Libraries/Source/Compression/Compression.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ enum CompressionType
3232
COMPRESSION_MIN = 0,
3333
COMPRESSION_NONE = COMPRESSION_MIN,
3434
COMPRESSION_REFPACK,
35-
COMPRESSION_MAX = COMPRESSION_REFPACK,
3635
COMPRESSION_NOXLZH,
3736
COMPRESSION_ZLIB1,
3837
COMPRESSION_ZLIB2,
@@ -45,6 +44,7 @@ enum CompressionType
4544
COMPRESSION_ZLIB9,
4645
COMPRESSION_BTREE,
4746
COMPRESSION_HUFF,
47+
COMPRESSION_MAX = COMPRESSION_HUFF,
4848
};
4949

5050
class CompressionManager

Core/Libraries/Source/Compression/CompressionManager.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ const char *CompressionManager::getCompressionNameByType( CompressionType compTy
4545
static const char *s_compressionNames[COMPRESSION_MAX+1] = {
4646
"No compression",
4747
"RefPack",
48-
/*
4948
"LZHL",
5049
"ZLib 1 (fast)",
5150
"ZLib 2",
@@ -58,7 +57,6 @@ const char *CompressionManager::getCompressionNameByType( CompressionType compTy
5857
"ZLib 9 (slow)",
5958
"BTree",
6059
"Huff",
61-
*/
6260
};
6361
return s_compressionNames[compType];
6462
}
@@ -69,7 +67,6 @@ const char *CompressionManager::getDecompressionNameByType( CompressionType comp
6967
static const char *s_decompressionNames[COMPRESSION_MAX+1] = {
7068
"d_None",
7169
"d_RefPack",
72-
/*
7370
"d_NoxLZW",
7471
"d_ZLib1",
7572
"d_ZLib2",
@@ -82,7 +79,6 @@ const char *CompressionManager::getDecompressionNameByType( CompressionType comp
8279
"d_ZLib9",
8380
"d_BTree",
8481
"d_Huff",
85-
*/
8682
};
8783
return s_decompressionNames[compType];
8884
}

Core/Libraries/Source/WWVegas/CMakeLists.txt

+7-6
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@ target_include_directories(core_wwcommon INTERFACE
1818
.
1919
WWDebug
2020
WWLib
21+
WWMath
22+
WWSaveLoad
2123
)
2224

2325
# add_subdirectory(WWAudio)
2426
add_subdirectory(WWDebug)
2527
add_subdirectory(WWLib)
26-
# add_subdirectory(WWMath)
28+
add_subdirectory(WWMath)
2729
# add_subdirectory(Wwutil)
28-
# add_subdirectory(WWSaveLoad)
30+
add_subdirectory(WWSaveLoad)
2931
add_subdirectory(WWStub)
3032
# add_subdirectory(WW3D2)
3133
# add_subdirectory(WWDownload)
@@ -40,10 +42,9 @@ target_include_directories(core_wwvegas INTERFACE
4042
WWDebug
4143
#WWDownload
4244
WWLib
43-
#WWMath
44-
#WWSaveLoad
45+
WWMath
46+
WWSaveLoad
4547
#Wwutil
46-
#wwshade
4748
)
4849

4950
target_link_libraries(core_wwvegas INTERFACE
@@ -52,7 +53,7 @@ target_link_libraries(core_wwvegas INTERFACE
5253
# core_wwdownload
5354
core_wwlib
5455
# core_wwmath
55-
# core_wwsaveload
56+
core_wwsaveload
5657
# core_wwshade
5758
# core_wwutil
5859
)

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

+9-1
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

+6-2
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

-1
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/CMakeLists.txt

+15-10
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ set(WWLIB_SRC
7171
#md5.h
7272
mempool.h
7373
mmsys.h
74-
mpu.cpp
75-
MPU.H
7674
multilist.cpp
7775
multilist.h
7876
mutex.cpp
@@ -91,8 +89,6 @@ set(WWLIB_SRC
9189
RANDOM.H
9290
rawfile.cpp
9391
RAWFILE.H
94-
rcfile.cpp
95-
rcfile.h
9692
readline.cpp
9793
readline.h
9894
realcrc.cpp
@@ -102,8 +98,6 @@ set(WWLIB_SRC
10298
refcount.h
10399
#regexpr.cpp
104100
#regexpr.h
105-
registry.cpp
106-
registry.h
107101
#search.h
108102
sharebuf.h
109103
Signaler.h
@@ -134,14 +128,10 @@ set(WWLIB_SRC
134128
uarray.h
135129
vector.cpp
136130
Vector.H
137-
verchk.cpp
138-
verchk.h
139131
visualc.h
140132
widestring.cpp
141133
widestring.h
142134
win.h
143-
WWCOMUtil.cpp
144-
WWCOMUtil.h
145135
wwfile.cpp
146136
WWFILE.H
147137
wwstring.cpp
@@ -152,6 +142,21 @@ set(WWLIB_SRC
152142
XSTRAW.H
153143
)
154144

145+
if(WIN32)
146+
list(APPEND WWLIB_SRC
147+
mpu.cpp
148+
MPU.H
149+
rcfile.cpp
150+
rcfile.h
151+
registry.cpp
152+
registry.h
153+
verchk.cpp
154+
verchk.h
155+
WWCOMUtil.cpp
156+
WWCOMUtil.h
157+
)
158+
endif()
159+
155160
# Targets to build.
156161
add_library(core_wwlib STATIC)
157162
set_target_properties(core_wwlib PROPERTIES OUTPUT_NAME wwlib)

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
#define CRC_H
4242

4343
#include <stdlib.h>
44-
#ifdef _UNIX
45-
#include "osdep.h"
46-
#endif
44+
45+
// TheSuperHackers @compile feliwir 17/04/2025 include _ltrotl macros
46+
#include <Utility/intrin_compat.h>
4747

4848
/*
4949
** This is a CRC engine class. It will process submitted data and generate a CRC from it.

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*/
1818

1919
#include "FastAllocator.h"
20-
#include <new.h>
20+
#include <new>
2121

2222
static FastAllocatorGeneral* generalAllocator; //This general allocator will do all allocations for us.
2323

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
#include <assert.h>
6262
#include <stdlib.h>
6363
#include <string.h>
64-
#include <new.h>
64+
#include <new>
6565

6666
#ifdef _MSC_VER
6767
#pragma warning (disable : 4702) // unreachable code, happens with some uses of these templates

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

-4
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@
4040
#ifndef WWFILE_Hx
4141
#define WWFILE_Hx
4242

43-
#ifdef _UNIX
44-
#include "osdep.h"
45-
#endif
46-
4743
#define YEAR(dt) (((dt & 0xFE000000) >> (9 + 16)) + 1980)
4844
#define MONTH(dt) ((dt & 0x01E00000) >> (5 + 16))
4945
#define DAY(dt) ((dt & 0x001F0000) >> (0 + 16))

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

+3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
#include <assert.h>
4444
#include <new>
4545

46+
// TheSuperHackers @compile feliwir 17/04/2025 include utility macros for cross-platform compatibility
47+
#include <Utility/compat.h>
48+
4649
// Disable warning about exception handling not being enabled. It's used as part of STL - in a part of STL we don't use.
4750
#pragma warning(disable : 4530)
4851

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

-4
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@
4747
#include "always.h"
4848
#endif
4949

50-
#ifdef _UNIX
51-
#include "osdep.h"
52-
#endif
53-
5450
// Used to parse command line that is passed into WinMain.
5551
// It also has the ability to load a file with values to append to the command line.
5652
// Normally in WinMain() there would be a call Argv::Init(lpCmdLine, fileprefix).

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

+15-8
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@
2121
#include "wwdebug.h"
2222
#include "thread.h"
2323
#pragma warning (disable : 4201) // Nonstandard extension - nameless struct
24-
#include <windows.h>
2524
#include "systimer.h"
2625
#include <Utility/intrin_compat.h>
2726

27+
#ifdef _WIN32
28+
#include <windows.h>
29+
#endif
30+
2831
#ifdef _UNIX
2932
# include <time.h> // for time(), localtime() and timezone variable.
3033
#endif
@@ -57,7 +60,7 @@ int CPUDetectClass::ProcessorFamily;
5760
int CPUDetectClass::ProcessorModel;
5861
int CPUDetectClass::ProcessorRevision;
5962
int CPUDetectClass::ProcessorSpeed;
60-
__int64 CPUDetectClass::ProcessorTicksPerSecond; // Ticks per second
63+
sint64 CPUDetectClass::ProcessorTicksPerSecond; // Ticks per second
6164
double CPUDetectClass::InvProcessorTicksPerSecond; // 1.0 / Ticks per second
6265

6366
unsigned CPUDetectClass::FeatureBits;
@@ -125,10 +128,10 @@ const char* CPUDetectClass::Get_Processor_Manufacturer_Name()
125128

126129
#define ASM_RDTSC _asm _emit 0x0f _asm _emit 0x31
127130

128-
static unsigned Calculate_Processor_Speed(__int64& ticks_per_second)
131+
static unsigned Calculate_Processor_Speed(sint64& ticks_per_second)
129132
{
130-
unsigned __int64 timer0=0;
131-
unsigned __int64 timer1=0;
133+
sint64 timer0=0;
134+
sint64 timer1=0;
132135

133136
timer0=_rdtsc();
134137

@@ -138,8 +141,8 @@ static unsigned Calculate_Processor_Speed(__int64& ticks_per_second)
138141
timer1=_rdtsc();
139142
}
140143

141-
__int64 t=timer1-timer0;
142-
ticks_per_second=(__int64)((1000.0/(double)elapsed)*(double)t); // Ticks per second
144+
sint64 t=timer1-timer0;
145+
ticks_per_second=(sint64)((1000.0/(double)elapsed)*(double)t); // Ticks per second
143146
return unsigned((double)t/(double)(elapsed*1000));
144147
}
145148

@@ -898,8 +901,8 @@ void CPUDetectClass::Init_Memory()
898901

899902
void CPUDetectClass::Init_OS()
900903
{
901-
OSVERSIONINFO os;
902904
#ifdef WIN32
905+
OSVERSIONINFO os;
903906
os.dwOSVersionInfoSize = sizeof(os);
904907
GetVersionEx(&os);
905908

@@ -940,9 +943,11 @@ void CPUDetectClass::Init_Processor_Log()
940943

941944
SYSLOG(("Operating System: "));
942945
switch (OSVersionPlatformId) {
946+
#ifdef _WIN32
943947
case VER_PLATFORM_WIN32s: SYSLOG(("Windows 3.1")); break;
944948
case VER_PLATFORM_WIN32_WINDOWS: SYSLOG(("Windows 9x")); break;
945949
case VER_PLATFORM_WIN32_NT: SYSLOG(("Windows NT")); break;
950+
#endif
946951
}
947952
SYSLOG(("\r\n"));
948953

@@ -1223,6 +1228,7 @@ void Get_OS_Info(
12231228
switch (OSVersionPlatformId) {
12241229
default:
12251230
break;
1231+
#ifdef _WIN32
12261232
case VER_PLATFORM_WIN32_WINDOWS:
12271233
{
12281234
for(int i=0;i<sizeof(Windows9xVersionTable)/sizeof(os_info);++i) {
@@ -1304,5 +1310,6 @@ void Get_OS_Info(
13041310

13051311
// No more-specific version detected; fallback to XX
13061312
os_info.Code="WINXX";
1313+
#endif
13071314
}
13081315
}

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

-3
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@
3838
#include "hash.h"
3939
#include "wwdebug.h"
4040
#include "realcrc.h"
41-
#ifdef _UNIX
42-
#include "osdep.h"
43-
#endif
4441

4542
#include <string.h>
4643

0 commit comments

Comments
 (0)