mirror of
https://github.com/nicbarker/clay.git
synced 2025-04-14 02:08:04 +00:00
Fixed a bug in the CLAY macro that would cause an infinite loop if 256 for loops ended at the same time (i.e. without another for loop starting). This was caused by the CLAY__ELEMENT_DEFINITION_LATCH static uint8_t overflowing to 0 when incremented in the post-loop step which causes the loop to wrongfully run a second time
This commit is contained in:
parent
5009146c65
commit
08d4a22121
2
clay.h
2
clay.h
@ -132,7 +132,7 @@ static uint8_t CLAY__ELEMENT_DEFINITION_LATCH;
|
||||
for ( \
|
||||
CLAY__ELEMENT_DEFINITION_LATCH = (Clay__OpenElement(), Clay__ConfigureOpenElement(CLAY__CONFIG_WRAPPER(Clay_ElementDeclaration, __VA_ARGS__)), 0); \
|
||||
CLAY__ELEMENT_DEFINITION_LATCH < 1; \
|
||||
++CLAY__ELEMENT_DEFINITION_LATCH, Clay__CloseElement() \
|
||||
CLAY__ELEMENT_DEFINITION_LATCH=1, Clay__CloseElement() \
|
||||
)
|
||||
|
||||
// These macros exist to allow the CLAY() macro to be called both with an inline struct definition, such as
|
||||
|
Loading…
Reference in New Issue
Block a user