Because we only ever call Pos_ReadDirect (and through that, DataRead<T>)

from JIT generated code, the compiler may not get the heads-up to properly
prepare for run-time instantiation of those template functions.

Explicitly instantiating Pos_ReadDirect gets around that issue.

Also force DataRead* inline as gcc didn't always do that itself when the
DataRead functions in turn were called from (other) template functions.

I am far from a C++ language lawyer, so I cannot speak learnedly about the
correctness of this solution, but it works.

Dolphin.app built on OS X 10.6 now actually works on 10.5 as well.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5901 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Soren Jorvang
2010-07-18 05:31:51 +00:00
parent 2c419382c9
commit faf586e8f1
4 changed files with 40 additions and 35 deletions

View File

@ -92,11 +92,21 @@ void Pos_ReadDirect()
VertexManager::s_pCurBufferPointer += 12;
}
// Explicitly instantiate these functions to decrease the possibility of
// symbol binding problems when (only) calling them from JIT compiled code.
template void Pos_ReadDirect<u8, true>();
template void Pos_ReadDirect<s8, true>();
template void Pos_ReadDirect<u16, true>();
template void Pos_ReadDirect<s16, true>();
template void Pos_ReadDirect<u8, false>();
template void Pos_ReadDirect<s8, false>();
template void Pos_ReadDirect<u16, false>();
template void Pos_ReadDirect<s16, false>();
void LOADERDECL Pos_ReadDirect_UByte3() { Pos_ReadDirect<u8, true>(); }
void LOADERDECL Pos_ReadDirect_Byte3() { Pos_ReadDirect<s8, true>(); }
void LOADERDECL Pos_ReadDirect_UShort3() { Pos_ReadDirect<u16, true>(); }
void LOADERDECL Pos_ReadDirect_Short3() { Pos_ReadDirect<s16, true>(); }
void LOADERDECL Pos_ReadDirect_UByte2() { Pos_ReadDirect<u8, false>(); }
void LOADERDECL Pos_ReadDirect_Byte2() { Pos_ReadDirect<s8, false>(); }
void LOADERDECL Pos_ReadDirect_UShort2() { Pos_ReadDirect<u16, false>(); }