GCS  0.2.3
gu_macros.hpp
1 // Copyright (C) 2009 Codership Oy <info@codership.com>
2 
9 #ifndef _gu_macros_hpp_
10 #define _gu_macros_hpp_
11 
12 /* To protect against "old-style" casts in libc macros
13  * must be included after respective libc headers */
14 #if defined(SIG_IGN)
15 extern "C" { static void (* const GU_SIG_IGN)(int) = SIG_IGN; }
16 #endif
17 
18 #if defined(MAP_FAILED)
19 extern "C" { static const void* const GU_MAP_FAILED = MAP_FAILED; }
20 #endif
21 
22 namespace gu
23 {
24  template<bool> struct CompileAssert {};
25 } /* namespace gu */
26 
27 #define GU_COMPILE_ASSERT(expr,msg) \
28  typedef gu::CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] __attribute__((unused))
29 
30 #endif /* _gu_macros_hpp_ */
Definition: gu_macros.hpp:24