From: Laszlo T. <ave...@us...> - 2010-04-24 14:21:37
|
gemrb: Infinity Engine emulator The branch master has been updated via 536fe3aee2b9873dba43d97b51a6f31d3a1bc3ec (commit) via 289dfb56f4a6b5070523a70a6389623606fed1f1 (commit) via 74c46799744d5cd761e0544ae26091c1c9f98907 (commit) Summary of changes: gemrb/core/Interface.h | 5 ++++ gemrb/core/PluginMgr.h | 2 +- gemrb/includes/plugindef.h | 45 ++++++++++++++++++++++++++----------------- 3 files changed, 33 insertions(+), 19 deletions(-) from 02599f3f39f8e3e45677521f3ed449e4ff9242a8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=536fe3aee2b9873dba43d97b51a6f31d3a1bc3ec commit 536fe3aee2b9873dba43d97b51a6f31d3a1bc3ec Author: Avenger <ave...@so...> Date: Sat Apr 24 16:09:43 2010 +0200 fixed msvc6 compile problem diff --git a/gemrb/core/PluginMgr.h b/gemrb/core/PluginMgr.h index b122fb3..9c89acf 100644 --- a/gemrb/core/PluginMgr.h +++ b/gemrb/core/PluginMgr.h @@ -35,6 +35,7 @@ #include <list> #include <cstring> #include <map> +#include "ResourceDesc.h" #ifdef WIN32 typedef HINSTANCE LibHandle; @@ -43,7 +44,6 @@ typedef void *LibHandle; #endif class Resource; -class ResourceDesc; class TypeID; class Plugin; http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=289dfb56f4a6b5070523a70a6389623606fed1f1 commit 289dfb56f4a6b5070523a70a6389623606fed1f1 Author: Avenger <ave...@so...> Date: Sat Apr 24 16:07:18 2010 +0200 fixed program database bug warning for msvc6 diff --git a/gemrb/core/Interface.h b/gemrb/core/Interface.h index 6c0ea0f..a60f8b8 100644 --- a/gemrb/core/Interface.h +++ b/gemrb/core/Interface.h @@ -26,6 +26,11 @@ #ifndef INTERFACE_H #define INTERFACE_H +//skip messy warnings in MSVC6 +#ifdef WIN32 +#pragma warning(disable:4786) +#endif + #include "exports.h" #include <map> #include "SClassID.h" http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=74c46799744d5cd761e0544ae26091c1c9f98907 commit 74c46799744d5cd761e0544ae26091c1c9f98907 Author: Avenger <ave...@so...> Date: Sat Apr 24 16:06:17 2010 +0200 fixed msvc6 compile problem (plugin templates) diff --git a/gemrb/includes/plugindef.h b/gemrb/includes/plugindef.h index de1f8e8..d408bec 100644 --- a/gemrb/includes/plugindef.h +++ b/gemrb/includes/plugindef.h @@ -31,22 +31,26 @@ #include "PluginMgr.h" template <typename T> -Plugin* CreatePlugin() -{ - return new T(); -} +struct CreatePlugin { + static Plugin *func() + { + return new T(); + } +}; template <typename Res> -Resource* CreateResource(DataStream *str) -{ - Res *res = new Res(); - if (res->Open(str)) { - return res; - } else { - delete res; - return NULL; +struct CreateResource { + static Resource* func(DataStream *str) + { + Res *res = new Res(); + if (res->Open(str)) { + return res; + } else { + delete res; + return NULL; + } } -} +}; #ifdef WIN32 #include <windows.h> @@ -72,18 +76,23 @@ GEM_EXPORT_DLL const char* GemRBPlugin_Version() return desc; \ } \ GEM_EXPORT_DLL bool GemRBPlugin_Register(PluginMgr *mgr) { + #define PLUGIN_CLASS(id, cls) \ - if (!mgr->RegisterPlugin(id, CreatePlugin<cls>)) \ - return false; + if (!mgr->RegisterPlugin(id, &CreatePlugin<cls>::func ))\ + return false; + #define PLUGIN_RESOURCE(cls, ext) \ - mgr->RegisterResource(&cls::ID, &CreateResource<cls>, ext); + mgr->RegisterResource(&cls::ID, &CreateResource<cls>::func, ext); + #define PLUGIN_IE_RESOURCE(cls, ext, ie_id) \ - mgr->RegisterResource(&cls::ID, &CreateResource<cls>, ext, ie_id); + mgr->RegisterResource(&cls::ID, &CreateResource<cls>::func, ext, ie_id); + #define PLUGIN_CLEANUP(func) \ core->RegisterCleanup(func); + #define END_PLUGIN() \ /* mgr is not null (this makes mgr used) */ \ - return mgr; \ + return mgr!=0; \ } ----------------------------------------------------------------------- This is an automated email from the git hooks/post-receive script. -- gemrb: Infinity Engine emulator |