1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-01-04 00:23:25 +08:00

Fix or workaround some tier1 compilation errors

This commit is contained in:
Nick Hastings 2024-05-14 10:04:46 -04:00
parent c3e11ddeae
commit 0f4322ea95
4 changed files with 14 additions and 6 deletions

View File

@ -32,9 +32,9 @@ CPLUS = /usr/bin/clang++
CLINK = /usr/bin/clang CLINK = /usr/bin/clang
CPP_LIB = CPP_LIB =
else else
CC = /usr/bin/gcc CC = /usr/bin/clang
CPLUS = /usr/bin/g++ CPLUS = /usr/bin/clang++
CLINK = /usr/bin/gcc CLINK = /usr/bin/clang
CPP_LIB = $(SRCDS_DIR)/bin/libstdc++.so.6 CPP_LIB = $(SRCDS_DIR)/bin/libstdc++.so.6
endif endif
@ -96,7 +96,7 @@ DEFINES +=-DGNUC -DPOSIX -D_POSIX -DVPROF_LEVEL=1 -DSWDS -D_finite=finite -Dstri
UNDEF = -Usprintf -Ustrncpy -UPROTECTED_THINGS_ENABLE UNDEF = -Usprintf -Ustrncpy -UPROTECTED_THINGS_ENABLE
BASE_CFLAGS = -fno-strict-aliasing -Wall -Wsign-compare -Werror -Wno-conversion -Wno-overloaded-virtual -Wno-non-virtual-dtor -Wno-invalid-offsetof \ BASE_CFLAGS = -fno-strict-aliasing -Wall -Wsign-compare -Werror -Wno-conversion -Wno-overloaded-virtual -Wno-non-virtual-dtor -Wno-invalid-offsetof \
-Wno-delete-non-virtual-dtor -Wno-delete-non-virtual-dtor -Wno-deprecated-register
SHLIBCFLAGS = -fPIC SHLIBCFLAGS = -fPIC
# Flags passed to the c compiler # Flags passed to the c compiler

View File

@ -983,7 +983,12 @@ private:
class TFRWL_ALIGN TT_CLASS CThreadSpinRWLock class TFRWL_ALIGN TT_CLASS CThreadSpinRWLock
{ {
public: public:
CThreadSpinRWLock() { COMPILE_TIME_ASSERT( sizeof( LockInfo_t ) == sizeof( int64 ) ); Assert( (int)this % 8 == 0 ); memset( this, 0, sizeof( *this ) ); } CThreadSpinRWLock() {
COMPILE_TIME_ASSERT( sizeof( LockInfo_t ) == sizeof( int64 ) );
Assert( (intp)this % 8 == 0 );
m_lockInfo.m_writerId = 0;
m_lockInfo.m_nReaders = 0;
}
bool TryLockForWrite(); bool TryLockForWrite();
bool TryLockForRead(); bool TryLockForRead();

View File

@ -1,4 +1,4 @@
//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======// //===== Copyright <EFBFBD> 1996-2005, Valve Corporation, All rights reserved. ======//
// //
// Purpose: // Purpose:
// //
@ -17,6 +17,7 @@
#include "tier0/dbg.h" #include "tier0/dbg.h"
#include <string.h> #include <string.h>
#include "tier0/platform.h" #include "tier0/platform.h"
#include "mathlib/mathlib.h"
#include "tier0/memalloc.h" #include "tier0/memalloc.h"
#include "tier0/memdbgon.h" #include "tier0/memdbgon.h"

View File

@ -867,7 +867,9 @@ int old_bf_read::ReadSBitLong( int numbits )
} }
const byte g_BitMask[8] = {0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80}; const byte g_BitMask[8] = {0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80};
#if FAST_BIT_SCAN
const byte g_TrailingMask[8] = {0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x80}; const byte g_TrailingMask[8] = {0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x80};
#endif
inline int old_bf_read::CountRunOfZeros() inline int old_bf_read::CountRunOfZeros()
{ {