1
0
mirror of https://github.com/alliedmodders/metamod-source.git synced 2024-11-29 11:24:19 +01:00

Backwards compat with outdated sourcehook.h

--HG--
extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/trunk%40506
This commit is contained in:
Pavol Marko 2007-10-12 20:14:10 +00:00
parent 2cb3fa14bc
commit 93ead5a2e0
2 changed files with 8 additions and 2 deletions

View File

@ -96,7 +96,7 @@ namespace SourceHook
{
if (p1->paramsPassInfo[i].type != p2->paramsPassInfo[i].type)
return false;
if (p1->paramsPassInfo[i].flags != p2->paramsPassInfo[i].flags)
if (GetRealFlags(p1->paramsPassInfo[i]) != GetRealFlags(p2->paramsPassInfo[i]))
return false;
}
}

View File

@ -70,9 +70,15 @@ namespace SourceHook
return m_Proto;
}
// For old sourcehook.h: flags 0 -> assume ByVal
static unsigned int GetRealFlags(const PassInfo &info)
{
return (info.flags == 0) ? PassInfo::PassFlag_ByVal : info.flags;
}
static size_t GetRealSize(const PassInfo &info)
{
if (info.flags & PassInfo::PassFlag_ByRef)
if (GetRealFlags(info) & PassInfo::PassFlag_ByRef)
{
return sizeof(void*);
}