From b94be2aa14049dfd8c502edbd5d2fbf165dc5396 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Tue, 15 Feb 2011 19:57:33 +0000 Subject: Fix from sparky for compile problem with older GCC --- intern/mikktspace/mikktspace.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'intern') diff --git a/intern/mikktspace/mikktspace.c b/intern/mikktspace/mikktspace.c index fae8c4edc8d..125725a44ff 100644 --- a/intern/mikktspace/mikktspace.c +++ b/intern/mikktspace/mikktspace.c @@ -434,7 +434,12 @@ static const int g_iCells = 2048; // it is IMPORTANT that this function is called to evaluate the hash since // inlining could potentially reorder instructions and generate different // results for the same effective input value fVal. -static volatile int FindGridCell(const float fMin, const float fMax, const float fVal) +#if defined(_MSC_VER) && !defined(FREE_WINDOWS) + #define NOINLINE __declspec(noinline) +#else + #define NOINLINE __attribute__((noinline)) +#endif +static NOINLINE int FindGridCell(const float fMin, const float fMax, const float fVal) { const float fIndex = (g_iCells-1) * ((fVal-fMin)/(fMax-fMin)); const int iIndex = fIndex<0?0:((int) (fIndex+0.5f)); -- cgit v1.2.3