summaryrefslogtreecommitdiffstats
path: root/src/Globals.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-04-30 17:05:13 +0200
committerMattes D <github@xoft.cz>2014-04-30 17:05:13 +0200
commit014fab58e6eafce87a092aa859c5008dbdaa5c7b (patch)
treeac4ea8515e0461483714e18cef7bbb961f0fbec3 /src/Globals.h
parentDelayed sending the KeepAlive packet for 3 seconds after login. (diff)
parentRemoved unneeded #includes. (diff)
downloadcuberite-014fab58e6eafce87a092aa859c5008dbdaa5c7b.tar
cuberite-014fab58e6eafce87a092aa859c5008dbdaa5c7b.tar.gz
cuberite-014fab58e6eafce87a092aa859c5008dbdaa5c7b.tar.bz2
cuberite-014fab58e6eafce87a092aa859c5008dbdaa5c7b.tar.lz
cuberite-014fab58e6eafce87a092aa859c5008dbdaa5c7b.tar.xz
cuberite-014fab58e6eafce87a092aa859c5008dbdaa5c7b.tar.zst
cuberite-014fab58e6eafce87a092aa859c5008dbdaa5c7b.zip
Diffstat (limited to 'src/Globals.h')
-rw-r--r--src/Globals.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/Globals.h b/src/Globals.h
index 26a0d87a9..a09819ce9 100644
--- a/src/Globals.h
+++ b/src/Globals.h
@@ -264,7 +264,21 @@ template class SizeChecker<UInt16, 2>;
// Same as assert but in all Self test builds
#ifdef SELF_TEST
-#define assert_test(x) ( !!(x) || (assert(!#x), exit(1), 0))
+ #define assert_test(x) ( !!(x) || (assert(!#x), exit(1), 0))
+#endif
+
+// Allow both Older versions of MSVC and newer versions of everything use a shared_ptr:
+// Note that we cannot typedef, because C++ doesn't allow (partial) templates to be typedeffed.
+#if (defined(_MSC_VER) && (_MSC_VER < 1600))
+ // MSVC before 2010 doesn't have std::shared_ptr, but has std::tr1::shared_ptr, defined in <memory> included earlier
+ #define SharedPtr std::tr1::shared_ptr
+#elif (__cplusplus >= 201103L)
+ // C++11 has std::shared_ptr in <memory>, included earlier
+ #define SharedPtr std::shared_ptr
+#else
+ // C++03 has std::tr1::shared_ptr in <tr1/memory>
+ #include <tr1/memory>
+ #define SharedPtr std::tr1::shared_ptr
#endif
@@ -296,7 +310,7 @@ T Clamp(T a_Value, T a_Min, T a_Max)
#ifndef TOLUA_TEMPLATE_BIND
-#define TOLUA_TEMPLATE_BIND(x)
+ #define TOLUA_TEMPLATE_BIND(x)
#endif