diff -r beffdec7d04c -r e023f17b7b73 sourcehook/sourcehook.h --- a/sourcehook/sourcehook.h Sun Aug 07 03:26:58 2005 +0000 +++ b/sourcehook/sourcehook.h Fri Aug 12 17:33:31 2005 +0000 @@ -68,10 +68,9 @@ #include "FastDelegate.h" #include "sh_memfuncinfo.h" #include "sh_memory.h" -#include +#include "smm_list.h" #include #include -#include // Good old metamod! @@ -185,8 +184,8 @@ int thisptr_offs; //!< This pointer offset }; void *ptr; //!< Pointer to the interface instance - std::list hooks_pre; //!< A list of pre-hooks - std::list hooks_post; //!< A list of post-hooks + List hooks_pre; //!< A list of pre-hooks + List hooks_post; //!< A list of post-hooks bool operator ==(void *other) const { return ptr == other; @@ -196,7 +195,7 @@ void *vfnptr; //!< Pointer to the function void *orig_entry; //!< The original vtable entry - typedef std::list IfaceList; + typedef List IfaceList; typedef IfaceList::iterator IfaceListIter; IfaceList ifaces; //!< List of interface pointers @@ -214,7 +213,7 @@ void *hookfunc_vfnptr; //!< Pointer to the hookfunc impl - typedef std::list VfnPtrList; + typedef List VfnPtrList; typedef VfnPtrList::iterator VfnPtrListIter; VfnPtrList vfnptrs; //!< List of hooked interfaces }; @@ -467,8 +466,7 @@ void *ourvfnptr = reinterpret_cast( \ *reinterpret_cast(reinterpret_cast(this) + ms_HI->vtbl_offs) + ms_HI->vtbl_idx); \ \ - HookManagerInfo::VfnPtrListIter vfptriter = std::find(ms_HI->vfnptrs.begin(), \ - ms_HI->vfnptrs.end(), ourvfnptr); \ + HookManagerInfo::VfnPtrListIter vfptriter = ms_HI->vfnptrs.find(ourvfnptr); \ if (vfptriter == ms_HI->vfnptrs.end()) \ { \ /* Bleh? Should be impossible! */ \ @@ -476,7 +474,7 @@ } \ HookManagerInfo::VfnPtr &vfnptr = *vfptriter; \ /* 2) Find the iface */ \ - HookManagerInfo::VfnPtr::IfaceListIter ifiter = std::find(vfnptr.ifaces.begin(), vfnptr.ifaces.end(), this); \ + HookManagerInfo::VfnPtr::IfaceListIter ifiter = vfnptr.ifaces.find(this); \ if (ifiter == vfnptr.ifaces.end()) \ { \ /* The iface info was not found. Redirect the call to the original function. */ \ @@ -486,8 +484,8 @@ } \ HookManagerInfo::VfnPtr::Iface &ci = *ifiter; \ /* 2) Declare some vars and set it up */ \ - std::list &prelist = ci.hooks_pre; \ - std::list &postlist = ci.hooks_post; \ + List &prelist = ci.hooks_pre; \ + List &postlist = ci.hooks_post; \ rettype orig_ret; \ rettype override_ret; \ rettype plugin_ret; \ @@ -501,7 +499,7 @@ #define SH_CALL_HOOKS(post, params) \ prev_res = MRES_IGNORED; \ - for (std::list::iterator hiter = post##list.begin(); hiter != post##list.end(); ++hiter) \ + for (List::iterator hiter = post##list.begin(); hiter != post##list.end(); ++hiter) \ { \ if (hiter->paused) continue; \ cur_res = MRES_IGNORED; \ @@ -544,8 +542,7 @@ void *ourvfnptr = reinterpret_cast( \ *reinterpret_cast(reinterpret_cast(this) + ms_HI->vtbl_offs) + ms_HI->vtbl_idx); \ \ - HookManagerInfo::VfnPtrListIter vfptriter = std::find(ms_HI->vfnptrs.begin(), \ - ms_HI->vfnptrs.end(), ourvfnptr); \ + HookManagerInfo::VfnPtrListIter vfptriter = ms_HI->vfnptrs.find(ourvfnptr); \ if (vfptriter == ms_HI->vfnptrs.end()) \ { \ /* Bleh? Should be impossible! */ \ @@ -553,7 +550,7 @@ } \ HookManagerInfo::VfnPtr &vfnptr = *vfptriter; \ /* 2) Find the iface */ \ - HookManagerInfo::VfnPtr::IfaceListIter ifiter = std::find(vfnptr.ifaces.begin(), vfnptr.ifaces.end(), this); \ + HookManagerInfo::VfnPtr::IfaceListIter ifiter = vfnptr.ifaces.find(this); \ if (ifiter == vfnptr.ifaces.end()) \ { \ /* The iface info was not found. Redirect the call to the original function. */ \ @@ -564,8 +561,8 @@ } \ HookManagerInfo::VfnPtr::Iface &ci = *ifiter; \ /* 2) Declare some vars and set it up */ \ - std::list &prelist = ci.hooks_pre; \ - std::list &postlist = ci.hooks_post; \ + List &prelist = ci.hooks_pre; \ + List &postlist = ci.hooks_post; \ META_RES &cur_res = SH_GLOB_SHPTR->GetCurResRef(); \ META_RES &prev_res = SH_GLOB_SHPTR->GetPrevResRef(); \ META_RES &status = SH_GLOB_SHPTR->GetStatusRef(); \ @@ -575,7 +572,7 @@ #define SH_CALL_HOOKS_void(post, params) \ prev_res = MRES_IGNORED; \ - for (std::list::iterator hiter = post##list.begin(); hiter != post##list.end(); ++hiter) \ + for (List::iterator hiter = post##list.begin(); hiter != post##list.end(); ++hiter) \ { \ if (hiter->paused) continue; \ cur_res = MRES_IGNORED; \