1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2024-12-23 01:59:43 +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
CPP_LIB =
else
CC = /usr/bin/gcc
CPLUS = /usr/bin/g++
CLINK = /usr/bin/gcc
CC = /usr/bin/clang
CPLUS = /usr/bin/clang++
CLINK = /usr/bin/clang
CPP_LIB = $(SRCDS_DIR)/bin/libstdc++.so.6
endif
@ -96,7 +96,7 @@ DEFINES +=-DGNUC -DPOSIX -D_POSIX -DVPROF_LEVEL=1 -DSWDS -D_finite=finite -Dstri
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 \
-Wno-delete-non-virtual-dtor
-Wno-delete-non-virtual-dtor -Wno-deprecated-register
SHLIBCFLAGS = -fPIC
# Flags passed to the c compiler

View File

@ -983,7 +983,12 @@ private:
class TFRWL_ALIGN TT_CLASS CThreadSpinRWLock
{
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 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:
//
@ -17,6 +17,7 @@
#include "tier0/dbg.h"
#include <string.h>
#include "tier0/platform.h"
#include "mathlib/mathlib.h"
#include "tier0/memalloc.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};
#if FAST_BIT_SCAN
const byte g_TrailingMask[8] = {0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x80};
#endif
inline int old_bf_read::CountRunOfZeros()
{