diff options
author | Nathan Letwory <nathan@letworyinteractive.com> | 2011-02-15 22:57:33 +0300 |
---|---|---|
committer | Nathan Letwory <nathan@letworyinteractive.com> | 2011-02-15 22:57:33 +0300 |
commit | b94be2aa14049dfd8c502edbd5d2fbf165dc5396 (patch) | |
tree | 3cccea749aefaab17b301da4602b8119c7e504f0 | |
parent | 610917d52e25a11636d308c1337883971b5e51f9 (diff) |
Fix from sparky for compile problem with older GCC
-rw-r--r-- | intern/mikktspace/mikktspace.c | 7 |
1 files changed, 6 insertions, 1 deletions
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)); |