Skip to content

Instantly share code, notes, and snippets.

@JJL772
Created July 18, 2020 22:34
Show Gist options
  • Save JJL772/ba9723b7700b3df3ad5de0e128ab00e6 to your computer and use it in GitHub Desktop.
Save JJL772/ba9723b7700b3df3ad5de0e128ab00e6 to your computer and use it in GitHub Desktop.
Fixes unresolved symbols when compiling the Source SDK 2013 on newer GCC toolchains. Note: you will need to enable -fabi-compat=2 for GCC to link properly
/**
*
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment