Skip to content

Commit

Permalink
Merge pull request #26 from ACBob/main
Browse files Browse the repository at this point in the history
Fix compiling on Linux
  • Loading branch information
Pinsplash authored Apr 20, 2023
2 parents bdaa596 + d62d802 commit 8ba6e4c
Show file tree
Hide file tree
Showing 13 changed files with 216 additions and 206 deletions.
Empty file modified sp/src/creategameprojects
100644 → 100755
Empty file.
Empty file modified sp/src/devtools/bin/linux/ccache
100644 → 100755
Empty file.
Empty file modified sp/src/devtools/bin/vpc
100644 → 100755
Empty file.
Empty file modified sp/src/devtools/bin/vpc_linux
100644 → 100755
Empty file.
Empty file modified sp/src/devtools/gendbg.sh
100644 → 100755
Empty file.
346 changes: 145 additions & 201 deletions sp/src/devtools/makefile_base_posix.mak

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions sp/src/game/server/hl2/hl2_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
/*
*/

// ACBOB: HACK! Commenting this include works on Linux. It does not work on windows.
// Preprocessor time!
#ifdef _WIN32
#include "cbase.h"
#endif

#include <string>
#include <cmath>
#include "hl2_player.h"
Expand Down
2 changes: 2 additions & 0 deletions sp/src/game/server/hl2/hl2_player.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ enum HL2PlayerPhysFlag_e
class IPhysicsPlayerController;
class CLogicPlayerProxy;

class CChaosEffect;

struct commandgoal_t
{
Vector m_vecGoalLocation;
Expand Down
2 changes: 2 additions & 0 deletions sp/src/game/server/triggers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"

bool g_bEndSolidTriggers = false;

#define DEBUG_TRANSITIONS_VERBOSE 2
ConVar g_debug_transitions( "g_debug_transitions", "0", FCVAR_NONE, "Set to 1 and restart the map to be warned if the map has no trigger_transition volumes. Set to 2 to see a dump of all entities & associated results during a transition." );

Expand Down
5 changes: 4 additions & 1 deletion sp/src/game/server/triggers.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
#include "basetoggle.h"
#include "entityoutput.h"
#include "EntityParticleTrail.h"
bool g_bEndSolidTriggers = false;

// ACBOB: This is global scope in a header, so should be externed...
extern bool g_bEndSolidTriggers;

//
// Spawnflags
//
Expand Down
11 changes: 7 additions & 4 deletions sp/src/public/tier1/utlblockmemory.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,13 @@ CUtlBlockMemory<T,I>::~CUtlBlockMemory()
template< class T, class I >
void CUtlBlockMemory<T,I>::Swap( CUtlBlockMemory< T, I > &mem )
{
swap( m_pMemory, mem.m_pMemory );
swap( m_nBlocks, mem.m_nBlocks );
swap( m_nIndexMask, mem.m_nIndexMask );
swap( m_nIndexShift, mem.m_nIndexShift );
// ACBOB: specifying this-> silences a LOT of warnings
// And I usually wouldn't care, but it makes the output unreadable and unusable junk.
// SO https://stackoverflow.com/a/15531940
this->swap( m_pMemory, mem.m_pMemory );
this->swap( m_nBlocks, mem.m_nBlocks );
this->swap( m_nIndexMask, mem.m_nIndexMask );
this->swap( m_nIndexShift, mem.m_nIndexShift );
}


Expand Down
50 changes: 50 additions & 0 deletions sp/src/tier1/math_proxy.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/**
*
* math_proxy.cpp - Implements certain unresolved symbols and points them to their proper endpoints
*
*/
#include <math.h>

#if __GNUC__ > 5

extern "C" float __powf_finite(float x, float y)
{
return powf(x, y);
}

extern "C" double __atan2_finite(double y, double x)
{
return atan2(y, x);
}

extern "C" float __logf_finite(float f)
{
return logf(f);
}

extern "C" float __acosf_finite(float f)
{
return acosf(f);
}

extern "C" double __exp_finite(double f)
{
return exp(f);
}

extern "C" float __expf_finite(float f)
{
return expf(f);
}

extern "C" double __pow_finite(double x, double y)
{
return pow(x, y);
}

extern "C" double __log_finite(double f)
{
return log(f);
}

#endif
1 change: 1 addition & 0 deletions sp/src/tier1/tier1.vpc
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ $Project "tier1"
$File "memstack.cpp"
$File "NetAdr.cpp"
$File "splitstring.cpp"
$File "math_proxy.cpp" [$POSIX]
$File "processor_detect.cpp" [$WINDOWS||$X360]
{
$Configuration
Expand Down

0 comments on commit 8ba6e4c

Please sign in to comment.