Pol  Revision:6c772dc
compileassert.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define arsize(a)   ( sizeof a / sizeof a[0] )
 
#define asserteql(a, b)   extern char xxxyyyzzz[(unsigned)1 - (unsigned)( a ^ ( b ) )]
 
#define assertofs(type, var, pos)   asserteql( offsetof( type, var ), pos )
 
#define assertsize(type, length)
 

Variables

char xxxyyyzzz [1]
 

Detailed Description

History
  • 2009/08/25 Shinigami: STLport-5.2.1 fix: additional parentheses in asserteql
  • 2010/03/27 Shinigami: Notes added.
Note
How does it work?
asserteql
defines one "char xxxyyyzzz[1];" globaly. per check it tries to define another "char xxxyyyzzz[1-(0)];" (a^(b) = a XOR b). if this is not possible, than it will fail, due to different definitions.
assertsize
tries to define two entries in a different way. if this is not possible, than it will fail, due to different definitions.
assertofs
will not be used.
Why we have asserteql and assertsize if it does the same? dunno
ATTENTION This header is part of the PCH Remove the include in all StdAfx.h files or live with the consequences :)

Definition in file compileassert.h.

Macro Definition Documentation

#define asserteql (   a,
 
)    extern char xxxyyyzzz[(unsigned)1 - (unsigned)( a ^ ( b ) )]

Definition at line 33 of file compileassert.h.

#define assertofs (   type,
  var,
  pos 
)    asserteql( offsetof( type, var ), pos )

Definition at line 34 of file compileassert.h.

#define assertsize (   type,
  length 
)
Value:
extern char size_##type[length]; \
extern char size_##type[sizeof( type )]

Definition at line 38 of file compileassert.h.

Variable Documentation

char xxxyyyzzz[1]