Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
cDebugAssert.h File Reference
#include "GrayCore.h"

Go to the source code of this file.

Classes

class  Gray::cDebugSourceLine
 
struct  Gray::cDebugAssert
 

Namespaces

 Gray
 < The main namespace for all Core functions.
 

Macros

#define STATIC_ASSERT(exp, name)   typedef int static_assert_##name [(exp) ? 1 : -1]
 
#define DEBUGSOURCELINE   ::Gray::cDebugSourceLine( __FILE__, __FUNCTION__, (WORD) __LINE__ )
 record the file and line this macro is used on. More...
 
#define ASSERT_THROW(exp)   if (!(exp)) { ::Gray::cDebugAssert::Assert_Throw(#exp, DEBUGSOURCELINE ); }
 
#define ASSERT_N(exp)   ASSERT_THROW(exp)
 
#define ASSERT(exp)   __noop
 
#define DEBUG_CHECK(exp)   __noop
 
#define DEBUG_ASSERT(exp, sDesc)   __noop
 

Typedefs

typedef const cDebugSourceLine & Gray::src
 

Functions

typedef Gray::bool (CALLBACK AssertCallback_t)(const char *pszExp
 

Detailed Description

A very simple header for basic support of asserts.

Macro Definition Documentation

◆ ASSERT

#define ASSERT (   exp)    __noop

◆ ASSERT_N

#define ASSERT_N (   exp)    ASSERT_THROW(exp)

◆ ASSERT_THROW

#define ASSERT_THROW (   exp)    if (!(exp)) { ::Gray::cDebugAssert::Assert_Throw(#exp, DEBUGSOURCELINE ); }

◆ DEBUG_ASSERT

#define DEBUG_ASSERT (   exp,
  sDesc 
)    __noop

◆ DEBUG_CHECK

#define DEBUG_CHECK (   exp)    __noop

◆ DEBUGSOURCELINE

#define DEBUGSOURCELINE   ::Gray::cDebugSourceLine( __FILE__, __FUNCTION__, (WORD) __LINE__ )

record the file and line this macro is used on.

FILE is valid for GNUC and _MSC_VER. ?? Should we get rid of this if !(defined(_DEBUG) || defined(_DEBUG_FAST))

◆ STATIC_ASSERT

#define STATIC_ASSERT (   exp,
  name 
)    typedef int static_assert_##name [(exp) ? 1 : -1]

static_assert = compile time assert. evaluates as a constant at compile time. like BOOST_STATIC_ASSERT

Note
: Takes a NON string name argument to support old compilers.