From a731e5cd5fff68cfb5c8156ff9ee1d1705f4e2a9 Mon Sep 17 00:00:00 2001 From: arcout Date: Thu, 16 Jul 2026 20:52:03 +0200 Subject: [PATCH] Made NOB_SVLIT a compile-time constant Remove the use of nob_sv_from_parts in NOB_SVLIT and replacing it by a simple struct initializer. The previous version made it impossible to initialize global string views using NOB_SVLIT. --- nob.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nob.h b/nob.h index 055a1df..92cda39 100644 --- a/nob.h +++ b/nob.h @@ -947,7 +947,7 @@ NOBDEF Nob_String_View nob_sv_from_parts(const char *data, size_t count); // nob_sb_to_sv() enables you to just view Nob_String_Builder as Nob_String_View #define nob_sb_to_sv(sb) nob_sv_from_parts((sb).items, (sb).count) -#define NOB_SVLIT(lit) nob_sv_from_parts((lit), sizeof(lit)-1) +#define NOB_SVLIT(lit) ((Nob_String_View){.data=(lit), .count=sizeof(lit)-1}) // printf macros for String_View #ifndef SV_Fmt