Fixed big bug where non-void functions could not be overriden / superceded

This commit is contained in:
Pavol Marko 2004-07-25 18:44:30 +00:00
parent a2edcc38b1
commit 26d5f430e2

View File

@ -34,12 +34,7 @@
// for varargs // for varargs
#define MAX_STRBUF_LEN 512 #define MAX_STRBUF_LEN 512
/*
void FakeError()
{
FDF;
}
*/
// Engine normal // Engine normal
#define FAKEMETA_ENGINE_HANDLE_void(pfnName, pfnArgs) \ #define FAKEMETA_ENGINE_HANDLE_void(pfnName, pfnArgs) \
@ -83,12 +78,12 @@ void FakeError()
/* Actual call */ \ /* Actual call */ \
curRet = (*iter).GetEngineFuncTable().pfn##pfnName pfnArgs; \ curRet = (*iter).GetEngineFuncTable().pfn##pfnName pfnArgs; \
/* Process return value */ \ /* Process return value */ \
mres = gpMetaGlobals->mres; \
if (mres >= MRES_OVERRIDE && mayOverride) \ if (mres >= MRES_OVERRIDE && mayOverride) \
{ \ { \
mayOverride = false; \ mayOverride = false; \
returnValue = curRet; \ returnValue = curRet; \
} \ } \
mres = gpMetaGlobals->mres; \
if (mres > status) \ if (mres > status) \
status = mres; \ status = mres; \
prev_mres = mres; \ prev_mres = mres; \
@ -154,12 +149,12 @@ void FakeError()
/* Actual call */ \ /* Actual call */ \
curRet = (*iter).GetEngineFuncTable_Post().pfn##pfnName pfnArgs; \ curRet = (*iter).GetEngineFuncTable_Post().pfn##pfnName pfnArgs; \
/* Process return value */ \ /* Process return value */ \
mres = gpMetaGlobals->mres; \
if (mres >= MRES_OVERRIDE && mayOverride) \ if (mres >= MRES_OVERRIDE && mayOverride) \
{ \ { \
mayOverride = false; \ mayOverride = false; \
returnValue = curRet; \ returnValue = curRet; \
} \ } \
mres = gpMetaGlobals->mres; \
if (mres > status) \ if (mres > status) \
status = mres; \ status = mres; \
prev_mres = mres; \ prev_mres = mres; \
@ -226,12 +221,12 @@ void FakeError()
/* Actual call */ \ /* Actual call */ \
curRet = (*iter).GetDllFuncTable().pfn##pfnName pfnArgs; \ curRet = (*iter).GetDllFuncTable().pfn##pfnName pfnArgs; \
/* Process return value */ \ /* Process return value */ \
mres = gpMetaGlobals->mres; \
if (mres >= MRES_OVERRIDE && mayOverride) \ if (mres >= MRES_OVERRIDE && mayOverride) \
{ \ { \
mayOverride = false; \ mayOverride = false; \
returnValue = curRet; \ returnValue = curRet; \
} \ } \
mres = gpMetaGlobals->mres; \
if (mres > status) \ if (mres > status) \
status = mres; \ status = mres; \
prev_mres = mres; \ prev_mres = mres; \
@ -285,12 +280,12 @@ void FakeError()
/* Actual call */ \ /* Actual call */ \
curRet = (*iter).GetDllFuncTable_Post().pfn##pfnName pfnArgs; \ curRet = (*iter).GetDllFuncTable_Post().pfn##pfnName pfnArgs; \
/* Process return value */ \ /* Process return value */ \
mres = gpMetaGlobals->mres; \
if (mres >= MRES_OVERRIDE && mayOverride) \ if (mres >= MRES_OVERRIDE && mayOverride) \
{ \ { \
mayOverride = false; \ mayOverride = false; \
returnValue = curRet; \ returnValue = curRet; \
} \ } \
mres = gpMetaGlobals->mres; \
if (mres > status) \ if (mres > status) \
status = mres; \ status = mres; \
prev_mres = mres; \ prev_mres = mres; \
@ -347,12 +342,12 @@ void FakeError()
/* Actual call */ \ /* Actual call */ \
curRet = (*iter).GetNewDllFuncTable().pfn##pfnName pfnArgs; \ curRet = (*iter).GetNewDllFuncTable().pfn##pfnName pfnArgs; \
/* Process return value */ \ /* Process return value */ \
mres = gpMetaGlobals->mres; \
if (mres >= MRES_OVERRIDE && mayOverride) \ if (mres >= MRES_OVERRIDE && mayOverride) \
{ \ { \
mayOverride = false; \ mayOverride = false; \
returnValue = curRet; \ returnValue = curRet; \
} \ } \
mres = gpMetaGlobals->mres; \
if (mres > status) \ if (mres > status) \
status = mres; \ status = mres; \
prev_mres = mres; \ prev_mres = mres; \
@ -406,12 +401,12 @@ void FakeError()
/* Actual call */ \ /* Actual call */ \
curRet = (*iter).GetNewDllFuncTable_Post().pfn##pfnName pfnArgs; \ curRet = (*iter).GetNewDllFuncTable_Post().pfn##pfnName pfnArgs; \
/* Process return value */ \ /* Process return value */ \
mres = gpMetaGlobals->mres; \
if (mres >= MRES_OVERRIDE && mayOverride) \ if (mres >= MRES_OVERRIDE && mayOverride) \
{ \ { \
mayOverride = false; \ mayOverride = false; \
returnValue = curRet; \ returnValue = curRet; \
} \ } \
mres = gpMetaGlobals->mres; \
if (mres > status) \ if (mres > status) \
status = mres; \ status = mres; \
prev_mres = mres; \ prev_mres = mres; \
@ -721,7 +716,8 @@ const char *Cmd_Args( void ) {
FAKEMETA_ENGINE_HANDLE(const char*, 0, Cmd_Args, ()); FAKEMETA_ENGINE_HANDLE(const char*, 0, Cmd_Args, ());
} }
const char *Cmd_Argv( int argc ) { const char *Cmd_Argv( int argc )
{
FAKEMETA_ENGINE_HANDLE(const char*, 0, Cmd_Argv, (argc)); FAKEMETA_ENGINE_HANDLE(const char*, 0, Cmd_Argv, (argc));
} }