Kawe Mazidjatari 2ca1a290e2 Revert back to using verctors for detours
Enabling LTCG caused the emplacement order to be different, which is most likely due to additional optimizations for the binary search logic. Reverted to fix this bug.
2023-07-03 15:37:25 +02:00

28 lines
792 B
C++

#ifndef IDETOUR_H
#define IDETOUR_H
//-----------------------------------------------------------------------------
// Interface class for context hooks
//-----------------------------------------------------------------------------
class IDetour
{
public:
virtual ~IDetour() { ; }
virtual void GetAdr(void) const = 0;
virtual void GetFun(void) const = 0;
virtual void GetVar(void) const = 0;
virtual void GetCon(void) const = 0;
virtual void Attach(void) const = 0;
virtual void Detach(void) const = 0;
};
extern std::vector<IDetour*> g_DetourVec;
std::size_t AddDetour(IDetour* pDetour);
#define ADDDETOUR(x,y) static std::size_t dummy_reg_##y = AddDetour( new x() );
#define XREGISTER(x,y) ADDDETOUR(x, y)
#define REGISTER(x) XREGISTER(x, __COUNTER__)
#endif // IDETOUR_H