//	MiscHelper.h - Various helpful bits and pieces.
//  ----------------------------------------------------------------------------

#ifndef MISCHELPER_H_
#define MISCHELPER_H_

///	Used to try and force the compiler to inline functions.
#ifdef WIN32
#define strictinline __forceinline
#elif defined (__GNUC__)
#define strictinline inline __attribute__((always_inline))
#else
#define strictinline inline
#endif

///	Cheap fake log approximation.
strictinline float fakeLog(float val)
{
	const float logCoeff = 1.0f - (1.0f/0.75f);

	return val/(val + (logCoeff*(val-1.0f)));
}

///	Cheap fake exp approximation.
strictinline float fakeExp(float val)
{
	const float expCoeff = 1.0f - (1.0f/0.1f);

	return val/(val + (expCoeff*(val-1.0f)));
}

#endif
