Use is_valid_enum_item in FOR_ENUM_ITEMS

This is part of the workaround for
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43680

Fixes DFHack/dfhack#654
Fixes JapaMala/armok-vision#21
develop
lethosor 2015-07-18 12:54:07 -04:00
parent 74404c62e7
commit 22ea68e68a
2 changed files with 2 additions and 2 deletions

@ -700,7 +700,7 @@ namespace DFHack {
#define ENUM_NEXT_ITEM(enum,val) \
(DFHack::next_enum_item<df::enum>(val))
#define FOR_ENUM_ITEMS(enum,iter) \
for(df::enum iter = ENUM_FIRST_ITEM(enum); iter <= ENUM_LAST_ITEM(enum); iter = df::enum(1+int(iter)))
for(df::enum iter = ENUM_FIRST_ITEM(enum); is_valid_enum_item(iter); iter = df::enum(1+int(iter)))
/*
* Include mandatory generated headers.

@ -1 +1 @@
Subproject commit a56692ae635a1e58db8a2cad64bb03fe75122ddd
Subproject commit ce779e70cc51d843b85e4a31a8bef1024748b4af