Skip to content

Commit

Permalink
GUI2/Generator: use static_assert to have actual compile-time assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
Vultraz committed Aug 25, 2017
1 parent b40d79d commit 3570877
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/gui/widgets/generator.cpp
Expand Up @@ -1133,7 +1133,7 @@ void show::init(grid* grid,
/***** ***** ***** ***** Helper macros ***** ***** ***** *****/

#ifdef GENERATE_PLACEMENT
char compile_assert[0];
static_assert(false, "GUI2/Generator: GENERATE_PLACEMENT already defined!");
#else
#define GENERATE_PLACEMENT \
switch(placement) { \
Expand Down Expand Up @@ -1167,7 +1167,7 @@ char compile_assert[0];
#endif

#ifdef GENERATE_SELECT
char compile_assert[0];
static_assert(false, "GUI2/Generator: GENERATE_SELECT already defined!");
#else
#define GENERATE_SELECT \
if(select) { \
Expand All @@ -1180,7 +1180,7 @@ char compile_assert[0];
#endif

#ifdef GENERATE_MAXIMUM
char compile_assert[0];
static_assert(false, "GUI2/Generator: GENERATE_MAXIMUM already defined!");
#else
#define GENERATE_MAXIMUM \
if(has_maximum) { \
Expand All @@ -1193,7 +1193,7 @@ char compile_assert[0];
#endif

#ifdef GENERATE_BODY
char compile_assert[0];
static_assert(false, "GUI2/Generator: GENERATE_BODY already defined!");
#else
#define GENERATE_BODY \
if(has_minimum) { \
Expand Down

0 comments on commit 3570877

Please sign in to comment.