From 1bf99b5fd26d142106d7a097900ebfe8a6279ad4 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sun, 9 Mar 2014 11:47:22 -0700 Subject: Be more parinoid about int sizes --- src/Globals.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/Globals.h') diff --git a/src/Globals.h b/src/Globals.h index 98611fc55..b046e6db0 100644 --- a/src/Globals.h +++ b/src/Globals.h @@ -81,7 +81,7 @@ #endif - +#include // Integral types with predefined sizes: @@ -96,8 +96,22 @@ typedef unsigned short UInt16; typedef unsigned char Byte; +// If you get an error about specialization check the size of integral types +template +class SizeChecker; + +template +class SizeChecker { + T v; +}; +template class SizeChecker; +template class SizeChecker; +template class SizeChecker; +template class SizeChecker; +template class SizeChecker; +template class SizeChecker; // A macro to disallow the copy constructor and operator= functions // This should be used in the private: declarations for any class that shouldn't allow copying itself @@ -179,7 +193,7 @@ typedef unsigned char Byte; #include #include #include - +#include -- cgit v1.2.3