diff --git a/cogl/cogl/cogl-bitmask.c b/cogl/cogl/cogl-bitmask.c index 17a6ed829..0bb7d4555 100644 --- a/cogl/cogl/cogl-bitmask.c +++ b/cogl/cogl/cogl-bitmask.c @@ -42,10 +42,7 @@ /* This code assumes that we can cast an unsigned long to a pointer and back without losing any data */ -_COGL_STATIC_ASSERT (sizeof (unsigned long) <= sizeof (void *), - "This toolchain breaks Cogl's assumption that it can " - "safely cast an unsigned long to a pointer without " - "losing data"); +G_STATIC_ASSERT (sizeof (unsigned long) <= sizeof (void *)); #define ARRAY_INDEX(bit_num) \ ((bit_num) / (sizeof (unsigned long) * 8)) diff --git a/cogl/cogl/cogl-pipeline.c b/cogl/cogl/cogl-pipeline.c index 1484a15eb..7c80af9d1 100644 --- a/cogl/cogl/cogl-pipeline.c +++ b/cogl/cogl/cogl-pipeline.c @@ -2357,11 +2357,12 @@ _cogl_pipeline_init_layer_state_hash_functions (void) _cogl_pipeline_layer_hash_fragment_snippets_state; { - /* So we get a big error if we forget to update this code! */ - _COGL_STATIC_ASSERT (COGL_PIPELINE_LAYER_STATE_SPARSE_COUNT == 9, - "Don't forget to install a hash function for new " - "pipeline state and update assert at end of " - "_cogl_pipeline_init_state_hash_functions"); + /* So we get a big error if we forget to update this code! + * Make sure to install a hash function for newly added + * pipeline state and update assert + * in _cogl_pipeline_init_state_hash_functions + */ + G_STATIC_ASSERT (COGL_PIPELINE_STATE_SPARSE_COUNT == 14); } } @@ -2465,11 +2466,12 @@ _cogl_pipeline_init_state_hash_functions (void) _cogl_pipeline_hash_fragment_snippets_state; { - /* So we get a big error if we forget to update this code! */ - _COGL_STATIC_ASSERT (COGL_PIPELINE_STATE_SPARSE_COUNT == 14, - "Make sure to install a hash function for " - "newly added pipeline state and update assert " - "in _cogl_pipeline_init_state_hash_functions"); + /* So we get a big error if we forget to update this code! + * Make sure to install a hash function for newly added + * pipeline state and update assert + * in _cogl_pipeline_init_state_hash_functions + */ + G_STATIC_ASSERT (COGL_PIPELINE_STATE_SPARSE_COUNT == 14); } } diff --git a/cogl/cogl/cogl-util.h b/cogl/cogl/cogl-util.h index f1009d41f..a32ce311a 100644 --- a/cogl/cogl/cogl-util.h +++ b/cogl/cogl/cogl-util.h @@ -99,19 +99,6 @@ _cogl_util_pixel_format_from_masks (unsigned long r_mask, int depth, int bpp, int byte_order); -/* _COGL_STATIC_ASSERT: - * @expression: An expression to assert evaluates to true at compile - * time. - * @message: A message to print to the console if the assertion fails - * at compile time. - * - * Allows you to assert that an expression evaluates to true at - * compile time and aborts compilation if not. If possible message - * will also be printed if the assertion fails. - */ -#define _COGL_STATIC_ASSERT(EXPRESSION, MESSAGE) \ - _Static_assert (EXPRESSION, MESSAGE); - static inline void _cogl_util_scissor_intersect (int rect_x0, int rect_y0,