mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-12-07 02:28:22 +00:00
Fix GCC compilation issues
This commit is contained in:
parent
c6bab37efe
commit
0ac0302c8e
@ -13,7 +13,7 @@
|
||||
|
||||
#include "const.h"
|
||||
#include "basehandle.h"
|
||||
#include "utllinkedlist.h"
|
||||
#include "tier1/utllinkedlist.h"
|
||||
#include "ihandleentity.h"
|
||||
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "convar.h"
|
||||
#include "tier1/convar.h"
|
||||
#include "icvar.h"
|
||||
#include "edict.h"
|
||||
#include "mathlib/vplane.h"
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
|
||||
|
||||
#include "cmodel.h"
|
||||
#include "utlvector.h"
|
||||
#include "tier1/utlvector.h"
|
||||
#include "ihandleentity.h"
|
||||
#include "ispatialpartition.h"
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@ public:
|
||||
virtual bool IsInitMessage( void ) const = 0;
|
||||
|
||||
virtual int GetRecipientCount( void ) const = 0;
|
||||
virtual CEntityIndex *GetRecipientIndex( CEntityIndex slot ) const = 0;
|
||||
virtual CEntityIndex GetRecipientIndex( int slot ) const = 0;
|
||||
};
|
||||
|
||||
#endif // IRECIPIENTFILTER_H
|
||||
|
||||
@ -12,8 +12,20 @@
|
||||
#include <tier1/bitbuf.h>
|
||||
#include "Color.h"
|
||||
|
||||
enum NetworkValidationMode_t;
|
||||
enum NetworkSerializationMode_t;
|
||||
enum NetworkValidationMode_t
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
enum NetworkSerializationMode_t
|
||||
{
|
||||
NET_SERIALIZATION_MODE_0 = 0x0,
|
||||
NET_SERIALIZATION_MODE_1 = 0x1,
|
||||
NET_SERIALIZATION_MODE_COUNT = 0x2,
|
||||
NET_SERIALIZATION_MODE_DEFAULT = 0x0,
|
||||
NET_SERIALIZATION_MODE_SERVER = 0x0,
|
||||
NET_SERIALIZATION_MODE_CLIENT = 0x1,
|
||||
};
|
||||
|
||||
typedef uint16 NetworkMessageId;
|
||||
typedef uint8 NetworkGroupId;
|
||||
|
||||
@ -892,7 +892,7 @@ template <> struct CAutoLockTypeDeducer<sizeof(CAlignedThreadFastMutex)> { typed
|
||||
|
||||
#ifdef COMPILER_GCC
|
||||
#define AUTO_LOCK( mutex ) \
|
||||
AUTO_LOCK_( typeof(CAutoLockTypeDeducer<sizeof(mutex)>::Type_t), mutex )
|
||||
AUTO_LOCK_( typename CAutoLockTypeDeducer<sizeof(mutex)>::Type_t, mutex )
|
||||
#else
|
||||
#define AUTO_LOCK( mutex ) \
|
||||
AUTO_LOCK_( CAutoLockTypeDeducer<sizeof(mutex)>::Type_t, mutex )
|
||||
@ -1135,7 +1135,7 @@ private:
|
||||
class ALIGN8 PLATFORM_CLASS CThreadSpinRWLock
|
||||
{
|
||||
public:
|
||||
CThreadSpinRWLock() { COMPILE_TIME_ASSERT( sizeof( LockInfo_t ) == sizeof( int64 ) ); Assert( (intp)this % 8 == 0 ); memset( this, 0, sizeof( *this ) ); }
|
||||
CThreadSpinRWLock() { COMPILE_TIME_ASSERT( sizeof( LockInfo_t ) == sizeof( int64 ) ); Assert( (intp)this % 8 == 0 ); memset( (void*)this, 0, sizeof( *this ) ); }
|
||||
|
||||
bool TryLockForWrite();
|
||||
bool TryLockForRead();
|
||||
|
||||
@ -206,8 +206,9 @@ class CBufferStringGrowable : public CBufferString
|
||||
friend class CBufferString;
|
||||
|
||||
public:
|
||||
CBufferStringGrowable() : m_nTotalCount(0), m_nAllocated(STACK_ALLOCATION_MARKER | (MAX_SIZE & LENGTH_MASK)), m_Memory()
|
||||
CBufferStringGrowable() : m_nTotalCount(0), m_nAllocated(STACK_ALLOCATION_MARKER | (MAX_SIZE & LENGTH_MASK))
|
||||
{
|
||||
memset(m_Memory.m_szString, 0, sizeof(m_Memory.m_szString));
|
||||
if (AllowHeapAllocation)
|
||||
{
|
||||
m_nAllocated |= ALLOW_HEAP_ALLOCATION;
|
||||
@ -272,8 +273,8 @@ private:
|
||||
|
||||
union
|
||||
{
|
||||
const char *m_pString;
|
||||
const char m_szString[MAX_SIZE];
|
||||
char *m_pString;
|
||||
char m_szString[MAX_SIZE];
|
||||
} m_Memory;
|
||||
};
|
||||
|
||||
|
||||
@ -383,7 +383,7 @@ inline CUtlSymbolLarge CUtlSymbolTableLargeBase<TreeType, CASEINSENSITIVE>::Find
|
||||
// use the string passed in the context
|
||||
int len = Q_strlen( pString ) + 1;
|
||||
|
||||
CUtlSymbolTableLargeBaseTreeEntry_t *search = (CUtlSymbolTableLargeBaseTreeEntry_t *)_alloca( len + sizeof( LargeSymbolTableHashDecoration_t ) );
|
||||
CUtlSymbolTableLargeBaseTreeEntry_t *search = (CUtlSymbolTableLargeBaseTreeEntry_t *)alloca( len + sizeof( LargeSymbolTableHashDecoration_t ) );
|
||||
search->m_Hash = CUtlSymbolLarge_Hash( CASEINSENSITIVE, pString, len );
|
||||
Q_memcpy( (char *)&search->m_String[ 0 ], pString, len );
|
||||
|
||||
|
||||
@ -12,8 +12,8 @@
|
||||
#include "Color.h"
|
||||
#include "entity2/entityidentity.h"
|
||||
#include "basehandle.h"
|
||||
#include "bufferstring.h"
|
||||
#include "utlscratchmemory.h"
|
||||
#include "tier1/bufferstring.h"
|
||||
#include "tier1/utlscratchmemory.h"
|
||||
|
||||
// Forward declaration
|
||||
class CEntityInstance;
|
||||
|
||||
@ -171,6 +171,23 @@ typedef CVariant ScriptVariant_t;
|
||||
|
||||
#define SCRIPT_VARIANT_NULL ScriptVariant_t()
|
||||
|
||||
template <typename T> struct ScriptDeducer { /*enum { FIELD_TYPE = FIELD_TYPEUNKNOWN };*/ };
|
||||
#define DECLARE_DEDUCE_FIELDTYPE( fieldType, type ) template<> struct ScriptDeducer<type> { enum { FIELD_TYPE = fieldType }; };
|
||||
|
||||
DECLARE_DEDUCE_FIELDTYPE( FIELD_VOID, void );
|
||||
DECLARE_DEDUCE_FIELDTYPE( FIELD_FLOAT, float );
|
||||
DECLARE_DEDUCE_FIELDTYPE( FIELD_CSTRING, const char * );
|
||||
DECLARE_DEDUCE_FIELDTYPE( FIELD_CSTRING, char * );
|
||||
DECLARE_DEDUCE_FIELDTYPE( FIELD_VECTOR, Vector );
|
||||
DECLARE_DEDUCE_FIELDTYPE( FIELD_VECTOR, const Vector & );
|
||||
DECLARE_DEDUCE_FIELDTYPE( FIELD_INTEGER, int );
|
||||
DECLARE_DEDUCE_FIELDTYPE( FIELD_BOOLEAN, bool );
|
||||
DECLARE_DEDUCE_FIELDTYPE( FIELD_CHARACTER, char );
|
||||
DECLARE_DEDUCE_FIELDTYPE( FIELD_HSCRIPT, HSCRIPT );
|
||||
DECLARE_DEDUCE_FIELDTYPE( FIELD_VARIANT, ScriptVariant_t );
|
||||
|
||||
#define ScriptDeduceType( T ) ScriptDeducer<T>::FIELD_TYPE
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
||||
struct ScriptFuncDescriptor_t
|
||||
|
||||
Loading…
Reference in New Issue
Block a user