@@ -407,12 +407,13 @@ extern "C" {
407407 #endif
408408#endif
409409
410+ /**< could be any type with semantic of standard bool, either equal or smaller than int */
410411#ifndef NK_BOOL
411412 #ifdef NK_INCLUDE_STANDARD_BOOL
412413 #include <stdbool.h>
413414 #define NK_BOOL bool
414415 #else
415- #define NK_BOOL int /**< could be char, use int for drop-in replacement backwards compatibility */
416+ #define NK_BOOL int
416417 #endif
417418#endif
418419
@@ -443,11 +444,7 @@ NK_STATIC_ASSERT(sizeof(nk_flags) >= 4);
443444NK_STATIC_ASSERT(sizeof(nk_rune) >= 4);
444445NK_STATIC_ASSERT(sizeof(nk_size) >= sizeof(void*));
445446NK_STATIC_ASSERT(sizeof(nk_ptr) >= sizeof(void*));
446- #ifdef NK_INCLUDE_STANDARD_BOOL
447- NK_STATIC_ASSERT(sizeof(nk_bool) == sizeof(bool));
448- #else
449- NK_STATIC_ASSERT(sizeof(nk_bool) >= 2);
450- #endif
447+ NK_STATIC_ASSERT(sizeof(nk_bool) <= sizeof(int));
451448
452449/* ============================================================================
453450 *
@@ -494,6 +491,10 @@ struct nk_nine_slice {struct nk_image img; nk_ushort l, t, r, b;};
494491struct nk_cursor {struct nk_image img; struct nk_vec2 size, offset;};
495492struct nk_scroll {nk_uint x, y;};
496493
494+ /* Make sure the semantic of nk_true/nk_false is compatible with nk_bool */
495+ NK_STATIC_ASSERT(!((nk_bool)0) == !(nk_false));
496+ NK_STATIC_ASSERT(!((nk_bool)1) == !(nk_true));
497+
497498enum nk_heading {NK_UP, NK_RIGHT, NK_DOWN, NK_LEFT};
498499enum nk_button_behavior {NK_BUTTON_DEFAULT, NK_BUTTON_REPEATER};
499500enum nk_modify {NK_FIXED = nk_false, NK_MODIFIABLE = nk_true};
@@ -2148,7 +2149,7 @@ NK_API void nk_window_show_if(struct nk_context *ctx, const char *name, enum nk_
21482149 * # # nk_window_show_if
21492150 * Line for visual separation. Draws a line with thickness determined by the current row height.
21502151 * ```c
2151- * void nk_rule_horizontal(struct nk_context *ctx, struct nk_color color, NK_BOOL rounding)
2152+ * void nk_rule_horizontal(struct nk_context *ctx, struct nk_color color, nk_bool rounding)
21522153 * ```
21532154 *
21542155 * Parameter | Description
@@ -6128,11 +6129,7 @@ NK_STATIC_ASSERT(sizeof(nk_short) == 2);
61286129NK_STATIC_ASSERT(sizeof(nk_uint) == 4);
61296130NK_STATIC_ASSERT(sizeof(nk_int) == 4);
61306131NK_STATIC_ASSERT(sizeof(nk_byte) == 1);
6131- #ifdef NK_INCLUDE_STANDARD_BOOL
6132- NK_STATIC_ASSERT(sizeof(nk_bool) == sizeof(bool));
6133- #else
6134- NK_STATIC_ASSERT(sizeof(nk_bool) == 4);
6135- #endif
6132+ NK_STATIC_ASSERT(sizeof(nk_bool) <= sizeof(int));
61366133
61376134NK_GLOBAL const struct nk_rect nk_null_rect = {-8192.0f, -8192.0f, 16384, 16384};
61386135#define NK_FLOAT_PRECISION 0.00000000000001
@@ -30757,6 +30754,7 @@ nk_tooltipfv(struct nk_context *ctx, const char *fmt, va_list args)
3075730754/// - [y]: Minor version with non-breaking API and library changes
3075830755/// - [z]: Patch version with no direct changes to the API
3075930756///
30757+ /// - 2026/01/31 (4.13.2) - Fix: replace incorrect static asserts for size(nk_bool)
3076030758/// - 2026/01/26 (4.13.1) - Fix: nk_do_property now uses NK_STRTOD via macro
3076130759/// - Fix: failure to build from source, due to
3076230760/// nuklear_math/util.c not declaring some functions
0 commit comments