Browse Source

Fix STATIC_ASSERT on gcc and change string sizes to 32bit ints.

Lloyd Weehuizen 15 years ago
parent
commit
1a3ea422b5
2 changed files with 12 additions and 3 deletions
  1. 11 2
      Include/Rocket/Core/Debug.h
  2. 1 1
      Include/Rocket/Core/StringBase.h

+ 11 - 2
Include/Rocket/Core/Debug.h

@@ -39,10 +39,9 @@
 #define ROCKET_BREAK _asm { int 0x03 }
 #endif
 
-#define ROCKET_STATIC_ASSERT(cond, msg) typedef char msg[(cond) ? 1 : 0]
 
 // Define the LT_ASSERT and ROCKET_VERIFY macros.
-#if 1 //!defined ROCKET_DEBUG
+#if !defined ROCKET_DEBUG
 #define ROCKET_ASSERT(x)
 #define ROCKET_ASSERTMSG(x, m)
 #define ROCKET_ERROR
@@ -85,4 +84,14 @@ if (!Rocket::Core::Assert(m, __FILE__, __LINE__)) \
 }
 #endif
 
+namespace Rocket {
+namespace Core {
+
+template <bool> struct STATIC_ASSERTION_FAILURE;
+template <> struct STATIC_ASSERTION_FAILURE<true>{};	
+	
+}
+}
+#define ROCKET_STATIC_ASSERT(cond, msg) Rocket::Core::STATIC_ASSERTION_FAILURE<cond> msg
+
 #endif

+ 1 - 1
Include/Rocket/Core/StringBase.h

@@ -41,7 +41,7 @@ template< typename T >
 class StringBase
 {
 public:
-	typedef size_t size_type;
+	typedef unsigned int size_type;
 	static const size_type npos = (size_type)-1;
 
 	StringBase();