Fixed large return values (Vectors) in MSVC.

This commit is contained in:
Steve Dudenhoeffer 2007-05-12 13:16:05 +00:00
parent 9b0ed67c9c
commit d38d2f56e1
2 changed files with 21 additions and 4 deletions

View File

@ -123,11 +123,12 @@ extern bool gDoForwards;
if (thisresult < HAM_OVERRIDE) \ if (thisresult < HAM_OVERRIDE) \
{ \ { \
memcpy(out, &origret, sizeof(Vector)); \ memcpy(out, &origret, sizeof(Vector)); \
return; \ return; \
} }
void Hook_Void_Void(Hook *hook, void *pthis) void Hook_Void_Void(Hook *hook, void *pthis)
{ {
PUSH_VOID() PUSH_VOID()
@ -652,8 +653,11 @@ void *Hook_Cbase_Void(Hook *hook, void *pthis)
} }
#ifdef _WIN32
void Hook_Vector_Void(Hook *hook, void *pthis, Vector *out)
#elif defined __linux__
void Hook_Vector_Void(Hook *hook, Vector *out, void *pthis) void Hook_Vector_Void(Hook *hook, Vector *out, void *pthis)
#endif
{ {
Vector ret; Vector ret;
Vector origret; Vector origret;
@ -683,8 +687,11 @@ void Hook_Vector_Void(Hook *hook, Vector *out, void *pthis)
memcpy(out, &ret, sizeof(Vector)); memcpy(out, &ret, sizeof(Vector));
} }
#ifdef _WIN32
void Hook_Vector_pVector(Hook *hook, void *pthis, Vector *out, Vector *v1)
#elif defined __linux__
void Hook_Vector_pVector(Hook *hook, Vector *out, void *pthis, Vector *v1) void Hook_Vector_pVector(Hook *hook, Vector *out, void *pthis, Vector *v1)
#endif
{ {
Vector ret; Vector ret;
Vector origret; Vector origret;

View File

@ -89,13 +89,23 @@ const bool RT_Cbase_Void = false;
const int PC_Cbase_Void = 0; const int PC_Cbase_Void = 0;
void *Hook_Cbase_Void(Hook *hook, void *pthis); void *Hook_Cbase_Void(Hook *hook, void *pthis);
const bool RT_Vector_Void = true; // HACK: I'm too lazy to fix up trampoline generator to deal with
// special return values. this is so much easier.
const bool RT_Vector_Void = false;
const int PC_Vector_Void = 1; const int PC_Vector_Void = 1;
#ifdef _WIN32
void Hook_Vector_Void(Hook *hook, void *pthis, Vector *out);
#elif defined __linux__
void Hook_Vector_Void(Hook *hook, Vector *out, void *pthis); void Hook_Vector_Void(Hook *hook, Vector *out, void *pthis);
#endif
const bool RT_Vector_pVector = true; const bool RT_Vector_pVector = true;
const int PC_Vector_pVector = 2; const int PC_Vector_pVector = 2;
#ifdef _WIN32
void Hook_Vector_pVector(Hook *hook, void *pthis, Vector *out, Vector *v1);
#elif defined __linux__
void Hook_Vector_pVector(Hook *hook, Vector *out, void *pthis, Vector *v1); void Hook_Vector_pVector(Hook *hook, Vector *out, void *pthis, Vector *v1);
#endif
const bool RT_Int_pVector = false; const bool RT_Int_pVector = false;
const int PC_Int_pVector = 1; const int PC_Int_pVector = 1;