@@ -4046,6 +4046,7 @@ NK_API int nk_strtoi(const char *str, char **endptr);
40464046NK_API float nk_strtof(const char *str, char **endptr);
40474047#ifndef NK_STRTOD
40484048#define NK_STRTOD nk_strtod
4049+ #define NK_STRTOD_NEEDED
40494050NK_API double nk_strtod(const char *str, char **endptr);
40504051#endif
40514052NK_API int nk_strfilter(const char *text, const char *regexp);
@@ -6151,29 +6152,36 @@ NK_GLOBAL const struct nk_color nk_yellow = {255,255,0,255};
61516152
61526153/* math */
61536154#ifndef NK_INV_SQRT
6155+ #define NK_INV_SQRT nk_inv_sqrt
6156+ #define NK_INV_SQRT_NEEDED
61546157NK_LIB float nk_inv_sqrt(float n);
61556158#endif
61566159#ifndef NK_SIN
6160+ #define NK_SIN nk_sin
6161+ #define NK_SIN_NEEDED
61576162NK_LIB float nk_sin(float x);
61586163#endif
61596164#ifndef NK_COS
6165+ #define NK_COS nk_cos
6166+ #define NK_COS_NEEDED
61606167NK_LIB float nk_cos(float x);
61616168#endif
61626169#ifndef NK_ATAN
6170+ #define NK_ATAN nk_atan
6171+ #define NK_ATAN_NEEDED
61636172NK_LIB float nk_atan(float x);
61646173#endif
61656174#ifndef NK_ATAN2
6175+ #define NK_ATAN2 nk_atan2
6176+ #define NK_ATAN2_NEEDED
61666177NK_LIB float nk_atan2(float y, float x);
61676178#endif
61686179NK_LIB nk_uint nk_round_up_pow2(nk_uint v);
61696180NK_LIB struct nk_rect nk_shrink_rect(struct nk_rect r, float amount);
61706181NK_LIB struct nk_rect nk_pad_rect(struct nk_rect r, struct nk_vec2 pad);
61716182NK_LIB void nk_unify(struct nk_rect *clip, const struct nk_rect *a, float x0, float y0, float x1, float y1);
6172- NK_LIB double nk_pow(double x, int n);
6173- NK_LIB int nk_ifloord(double x);
61746183NK_LIB int nk_ifloorf(float x);
61756184NK_LIB int nk_iceilf(float x);
6176- NK_LIB int nk_log10(double n);
61776185NK_LIB float nk_roundf(float x);
61786186
61796187/* util */
@@ -6184,15 +6192,21 @@ NK_LIB int nk_to_upper(int c);
61846192NK_LIB int nk_to_lower(int c);
61856193
61866194#ifndef NK_MEMCPY
6195+ #define NK_MEMCPY nk_memcopy
6196+ #define NK_MEMCPY_NEEDED
61876197NK_LIB void* nk_memcopy(void *dst, const void *src, nk_size n);
61886198#endif
61896199#ifndef NK_MEMSET
6200+ #define NK_MEMSET nk_memset
6201+ #define NK_MEMSET_NEEDED
61906202NK_LIB void nk_memset(void *ptr, int c0, nk_size size);
61916203#endif
61926204NK_LIB void nk_zero(void *ptr, nk_size size);
61936205NK_LIB char *nk_itoa(char *s, long n);
61946206NK_LIB int nk_string_float_limit(char *string, int prec);
61956207#ifndef NK_DTOA
6208+ #define NK_DTOA nk_dtoa
6209+ #define NK_DTOA_NEEDED
61966210NK_LIB char *nk_dtoa(char *s, double n);
61976211#endif
61986212NK_LIB int nk_text_clamp(const struct nk_user_font *font, const char *text, int text_len, float space, int *glyphs, float *text_width, nk_rune *sep_list, int sep_count);
@@ -6204,6 +6218,13 @@ NK_LIB int nk_strfmt(char *buf, int buf_size, const char *fmt, va_list args);
62046218NK_LIB char *nk_file_load(const char* path, nk_size* siz, const struct nk_allocator *alloc);
62056219#endif
62066220
6221+ /* math helpers that are only used by nk_dtoa */
6222+ #ifdef NK_DTOA_NEEDED
6223+ NK_LIB double nk_pow(double x, int n);
6224+ NK_LIB int nk_ifloord(double x);
6225+ NK_LIB int nk_log10(double n);
6226+ #endif
6227+
62076228/* buffer */
62086229#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
62096230NK_LIB void* nk_malloc(nk_handle unused, void *old,nk_size size);
@@ -6468,8 +6489,7 @@ nk_stbtt_free(void *ptr, void *user_data) {
64686489/// (it can actually approximate a lot more functions) can be
64696490/// found here: www.lolengine.net/wiki/oss/lolremez
64706491*/
6471- #ifndef NK_INV_SQRT
6472- #define NK_INV_SQRT nk_inv_sqrt
6492+ #ifdef NK_INV_SQRT_NEEDED
64736493NK_LIB float
64746494nk_inv_sqrt(float n)
64756495{
@@ -6483,8 +6503,7 @@ nk_inv_sqrt(float n)
64836503 return conv.f;
64846504}
64856505#endif
6486- #ifndef NK_SIN
6487- #define NK_SIN nk_sin
6506+ #ifdef NK_SIN_NEEDED
64886507NK_LIB float
64896508nk_sin(float x)
64906509{
@@ -6499,8 +6518,7 @@ nk_sin(float x)
64996518 return a0 + x*(a1 + x*(a2 + x*(a3 + x*(a4 + x*(a5 + x*(a6 + x*a7))))));
65006519}
65016520#endif
6502- #ifndef NK_COS
6503- #define NK_COS nk_cos
6521+ #ifdef NK_COS_NEEDED
65046522NK_LIB float
65056523nk_cos(float x)
65066524{
@@ -6518,8 +6536,7 @@ nk_cos(float x)
65186536 return a0 + x*(a1 + x*(a2 + x*(a3 + x*(a4 + x*(a5 + x*(a6 + x*(a7 + x*a8)))))));
65196537}
65206538#endif
6521- #ifndef NK_ATAN
6522- #define NK_ATAN nk_atan
6539+ #ifdef NK_ATAN_NEEDED
65236540NK_LIB float
65246541nk_atan(float x)
65256542{
@@ -6538,8 +6555,7 @@ nk_atan(float x)
65386555 return u;
65396556}
65406557#endif
6541- #ifndef NK_ATAN2
6542- #define NK_ATAN2 nk_atan2
6558+ #ifdef NK_ATAN2_NEEDED
65436559NK_LIB float
65446560nk_atan2(float y, float x)
65456561{
@@ -6576,6 +6592,7 @@ nk_round_up_pow2(nk_uint v)
65766592 v++;
65776593 return v;
65786594}
6595+ #ifdef NK_DTOA_NEEDED
65796596NK_LIB double
65806597nk_pow(double x, int n)
65816598{
@@ -6591,12 +6608,15 @@ nk_pow(double x, int n)
65916608 }
65926609 return plus ? r : 1.0 / r;
65936610}
6611+ #endif
6612+ #ifdef NK_DTOA_NEEDED
65946613NK_LIB int
65956614nk_ifloord(double x)
65966615{
65976616 x = (double)((int)x - ((x < 0.0) ? 1 : 0));
65986617 return (int)x;
65996618}
6619+ #endif
66006620NK_LIB int
66016621nk_ifloorf(float x)
66026622{
@@ -6615,6 +6635,7 @@ nk_iceilf(float x)
66156635 return (r > 0.0f) ? t+1: t;
66166636 }
66176637}
6638+ #ifdef NK_DTOA_NEEDED
66186639NK_LIB int
66196640nk_log10(double n)
66206641{
@@ -6631,6 +6652,7 @@ nk_log10(double n)
66316652 if (neg) exp = -exp;
66326653 return exp;
66336654}
6655+ #endif
66346656NK_LIB float
66356657nk_roundf(float x)
66366658{
@@ -6802,8 +6824,7 @@ NK_LIB nk_bool nk_is_upper(int c){return (c >= 'A' && c <= 'Z') || (c >= 0xC0 &&
68026824NK_LIB int nk_to_upper(int c) {return (c >= 'a' && c <= 'z') ? (c - ('a' - 'A')) : c;}
68036825NK_LIB int nk_to_lower(int c) {return (c >= 'A' && c <= 'Z') ? (c - ('a' + 'A')) : c;}
68046826
6805- #ifndef NK_MEMCPY
6806- #define NK_MEMCPY nk_memcopy
6827+ #ifdef NK_MEMCPY_NEEDED
68076828NK_LIB void*
68086829nk_memcopy(void *dst0, const void *src0, nk_size length)
68096830{
@@ -6861,8 +6882,7 @@ nk_memcopy(void *dst0, const void *src0, nk_size length)
68616882 return (dst0);
68626883}
68636884#endif
6864- #ifndef NK_MEMSET
6865- #define NK_MEMSET nk_memset
6885+ #ifdef NK_MEMSET_NEEDED
68666886NK_LIB void
68676887nk_memset(void *ptr, int c0, nk_size size)
68686888{
@@ -6953,6 +6973,7 @@ nk_strtoi(const char *str, char **endptr)
69536973 *endptr = (char *)p;
69546974 return neg*value;
69556975}
6976+ #ifdef NK_STRTOD_NEEDED
69566977NK_API double
69576978nk_strtod(const char *str, char **endptr)
69586979{
@@ -7010,6 +7031,7 @@ nk_strtod(const char *str, char **endptr)
70107031 *endptr = p;
70117032 return number;
70127033}
7034+ #endif
70137035NK_API float
70147036nk_strtof(const char *str, char **endptr)
70157037{
@@ -7288,8 +7310,7 @@ nk_itoa(char *s, long n)
72887310 nk_strrev_ascii(s);
72897311 return s;
72907312}
7291- #ifndef NK_DTOA
7292- #define NK_DTOA nk_dtoa
7313+ #ifdef NK_DTOA_NEEDED
72937314NK_LIB char*
72947315nk_dtoa(char *s, double n)
72957316{
@@ -28955,7 +28976,7 @@ nk_do_property(nk_flags *ws,
2895528976 break;
2895628977 case NK_PROPERTY_DOUBLE:
2895728978 nk_string_float_limit(buffer, NK_MAX_FLOAT_PRECISION);
28958- variant->value.d = nk_strtod (buffer, 0);
28979+ variant->value.d = NK_STRTOD (buffer, 0);
2895928980 variant->value.d = NK_CLAMP(variant->min_value.d, variant->value.d, variant->max_value.d);
2896028981 break;
2896128982 }
@@ -30736,6 +30757,12 @@ nk_tooltipfv(struct nk_context *ctx, const char *fmt, va_list args)
3073630757/// - [y]: Minor version with non-breaking API and library changes
3073730758/// - [z]: Patch version with no direct changes to the API
3073830759///
30760+ /// - 2026/01/26 (4.13.1) - Fix: nk_do_property now uses NK_STRTOD via macro
30761+ /// - Fix: failure to build from source, due to
30762+ /// nuklear_math/util.c not declaring some functions
30763+ /// - Fix: guard nk_strtod implementation with preprocessor
30764+ /// - Fix: nuklear_sdl3_renderer now provides NK_DTOA
30765+ /// - Fix: guard nk_pow, nk_ifloord, nk_log10 with preprocessor
3073930766/// - 2025/11/15 (4.13.0) - Fix: nk_property not updating 'win->edit.active'
3074030767/// Add new updated demo: sdl3_renderer
3074130768/// - 2025/10/08 (4.12.8) - Fix nk_widget_text to use NK_TEXT_ALIGN_LEFT by default,
0 commit comments