summaryrefslogtreecommitdiff
path: root/include/anope.h
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-09-02 08:30:54 -0400
committerAdam <Adam@anope.org>2012-09-02 08:30:54 -0400
commit1af64a9bbb150b9daae3944d6aae86864c271103 (patch)
treec24a1ac6793e997f83ac66810b611f88855fcd90 /include/anope.h
parente3d5140dcc936ff411c438b7e3997104cb5f085a (diff)
Fix Windows
Diffstat (limited to 'include/anope.h')
-rw-r--r--include/anope.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/anope.h b/include/anope.h
index 2ec6602ea..e67fafc8d 100644
--- a/include/anope.h
+++ b/include/anope.h
@@ -23,7 +23,7 @@ namespace Anope
* allow us to only require one type of string everywhere that can be converted
* at any time to a specific type of string.
*/
- class string
+ class CoreExport string
{
private:
/**
@@ -589,6 +589,18 @@ template<typename T, typename O> inline T anope_dynamic_static_cast(O ptr)
#endif
}
+template<typename T, typename O> inline T anope_dynamic_reinterpret_cast(O ptr)
+{
+#ifdef DEBUG_BUILD
+ T ret = dynamic_cast<T>(ptr);
+ if (ptr != NULL && ret == NULL)
+ throw CoreException(Anope::string("anope_dynamic_reinterpret_cast<") + typeid(T).name() + ">(" + typeid(O).name() + ") fail");
+ return ret;
+#else
+ return reinterpret_cast<T>(ptr);
+#endif
+}
+
/*************************************************************************/
/** Class with the ability to keep flags on items, they should extend from this