Skip to content

Commit 758bdd5

Browse files
committed
replace preprocessor #error with static_assert
ensures that constexpr constants are handled properly.
1 parent e834de2 commit 758bdd5

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

wled00/FX_fcn.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@
2828
19, 18, 17, 16, 15, 20, 21, 22, 23, 24, 29, 28, 27, 26, 25]}
2929
*/
3030

31-
#if MAX_NUM_SEGMENTS < WLED_MAX_BUSSES
32-
#error "Max segments must be at least max number of busses!"
33-
#endif
31+
static_assert(MAX_NUM_SEGMENTS >= WLED_MAX_BUSSES, "Max segments must be at least max number of busses!");
3432

3533

3634
///////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)