From b5b686a5196ac0c5677b2d889af63d1a44fe2a94 Mon Sep 17 00:00:00 2001 From: Pavol Marko Date: Mon, 3 Oct 2005 18:31:44 +0000 Subject: [PATCH] msvc/win32 compatibility --HG-- extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/trunk%40120 --- sourcehook/sh_list.h | 2 +- sourcehook/sourcehook.h | 2 +- sourcehook/test/testlist.cpp | 14 +++++++++----- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/sourcehook/sh_list.h b/sourcehook/sh_list.h index 96f1c35..3d2c67f 100644 --- a/sourcehook/sh_list.h +++ b/sourcehook/sh_list.h @@ -11,7 +11,7 @@ #ifndef _INCLUDE_SMM_LIST_H #define _INCLUDE_SMM_LIST_H -#include +#include namespace SourceHook { diff --git a/sourcehook/sourcehook.h b/sourcehook/sourcehook.h index af28eaf..315eaa7 100644 --- a/sourcehook/sourcehook.h +++ b/sourcehook/sourcehook.h @@ -134,7 +134,7 @@ namespace SourceHook HA_Unregister //!< Clear the saved pointer }; - class IHookManagerInfo; + struct IHookManagerInfo; /** * @brief Pointer to hook manager interface function diff --git a/sourcehook/test/testlist.cpp b/sourcehook/test/testlist.cpp index fe96a3f..9f8dad8 100644 --- a/sourcehook/test/testlist.cpp +++ b/sourcehook/test/testlist.cpp @@ -15,14 +15,17 @@ namespace { Hmm *m_This; int m_Int; - Hmm(const Hmm &other) : m_This(this), m_Int(other.m_Int) + Hmm(const Hmm &other) : m_Int(other.m_Int) { + m_This = this; } - Hmm(int i) : m_This(this), m_Int(i) + Hmm(int i) : m_Int(i) { + m_This = this; } - Hmm() : m_This(this), m_Int(0) + Hmm() : m_Int(0) { + m_This = this; } void operator = (const Hmm &other) { @@ -134,12 +137,13 @@ namespace // Find int ver = 1; - for (HashType::iterator iter = hash.begin(); iter != hash.end(); ++iter) + HashType::iterator iter; + for (iter = hash.begin(); iter != hash.end(); ++iter) CHECK_COND(iter->key == ver && iter->val == (ver++) + 5000, "Part2"); CHECK_COND(ver == mymax+1, "Part2.1"); - HashType::iterator iter = hash.find(300); + iter = hash.find(300); CHECK_COND(iter != hash.end() && iter->val == 300+5000, "Part3.1"); iter = hash.find(mymax+200); CHECK_COND(iter == hash.end(), "Part3.2");