Make sure semicolon is expected after DEFINE_NULL_DATA()

This commit is contained in:
Behdad Esfahbod 2010-04-22 10:26:35 -04:00
parent bb1e16335e
commit 565c80bd29
1 changed files with 3 additions and 2 deletions

View File

@ -82,11 +82,12 @@ static inline const Type& Null () {
/* Specializaiton for arbitrary-content arbitrary-sized Null objects. */ /* Specializaiton for arbitrary-content arbitrary-sized Null objects. */
#define DEFINE_NULL_DATA(Type, size, data) \ #define DEFINE_NULL_DATA(Type, size, data) \
static const char _Null##Type[size + 1] = data; \ static const char _Null##Type[size + 1] = data; /* +1 is for nul-termination in data */ \
template <> \ template <> \
inline const Type& Null<Type> () { \ inline const Type& Null<Type> () { \
return CONST_CAST (Type, *_Null##Type, 0); \ return CONST_CAST (Type, *_Null##Type, 0); \
} } /* The following line really exists such that we end in a place needing semicolon */ \
ASSERT_STATIC (sizeof (Type) + 1 <= sizeof (_Null##Type))
/* Accessor macro. */ /* Accessor macro. */
#define Null(Type) Null<Type>() #define Null(Type) Null<Type>()