Add _COGL_STATIC_ASSERT macro

This adds a _COGL_STATIC_ASSERT macro that can be used for compile time
assertions in C code. If supported by the compiler this macro uses
_Static_assert so that a message can be printed out if the assertion
fails.

Reviewed-by: Neil Roberts <neil@linux.intel.com>

(cherry picked from commit 465b39a764f2720e77678cafa56acb0e69007ffd)
This commit is contained in:
Robert Bragg
2012-04-16 17:23:15 +01:00
parent eaf29af7ee
commit 097d282b32
5 changed files with 81 additions and 4 deletions

View File

@@ -9,9 +9,9 @@
within Cogl. Cogl doesn't export the symbols for this data type so
we just directly include the source instead */
#define _COGL_IN_TEST_BITMASK
#include <cogl/cogl-bitmask.h>
#include <cogl/cogl-bitmask.c>
#define _COGL_IN_TEST_BITMASK
#include <cogl/cogl-util.c>
typedef struct