1
0
forked from 0ad/0ad

build fixes

This was SVN commit r7300.
This commit is contained in:
janwas 2010-02-02 13:57:52 +00:00
parent 10f0432fdf
commit cc0c3988d1
2 changed files with 7 additions and 10 deletions

View File

@ -127,15 +127,12 @@ switch(x % 2)
* *
* @param expression that is expected to evaluate to non-zero at compile-time. * @param expression that is expected to evaluate to non-zero at compile-time.
**/ **/
#define cassert(expr) typedef detail::static_assert_<(expr)>::type UID__ #define cassert(expr) typedef static_assert_<(expr)>::type UID__
namespace detail template<bool> struct static_assert_;
template<> struct static_assert_<true>
{ {
template<bool> struct static_assert_; typedef int type;
template<> struct static_assert_<true> };
{
typedef int type;
};
}
/** /**
* compile-time debug_assert. causes a compile error if the expression * compile-time debug_assert. causes a compile error if the expression

View File

@ -294,7 +294,7 @@ LIB_API TimerClient* timer_AddClient(TimerClient* tc, const wchar_t* description
**/ **/
#define TIMER_ADD_CLIENT(id)\ #define TIMER_ADD_CLIENT(id)\
static TimerClient UID__;\ static TimerClient UID__;\
static TimerClient* id = timer_AddClient(&UID__, WIDEN(#id)); static TimerClient* id = timer_AddClient(&UID__, WIDEN(#id))
/** /**
* bill the difference between t0 and t1 to the client's total. * bill the difference between t0 and t1 to the client's total.
@ -339,7 +339,7 @@ private:
* a string literal is safest. * a string literal is safest.
* *
* Example usage: * Example usage:
* TIMER_ADD_CLIENT(identifier) * TIMER_ADD_CLIENT(identifier);
* *
* void func() * void func()
* { * {