diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-11-15 14:10:28 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-11-15 14:33:46 -0500 |
| commit | af1bd79fd91d1a1efde3cf084643f065c61d330a (patch) | |
| tree | 32f9b64cf3b3f4b9120a67d1127302ce8147d797 /src/stdlib/text.h | |
| parent | 045574bf99230fc82d184e84ca5ce092fdd70de1 (diff) | |
Make EMPTY_TEXT into a macro
Diffstat (limited to 'src/stdlib/text.h')
| -rw-r--r-- | src/stdlib/text.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/stdlib/text.h b/src/stdlib/text.h index 821325a9..12b4bc20 100644 --- a/src/stdlib/text.h +++ b/src/stdlib/text.h @@ -27,6 +27,8 @@ typedef struct { #define Text(str) ((Text_t){.length = sizeof(str) - 1, .tag = TEXT_ASCII, .ascii = "" str}) +#define EMPTY_TEXT ((Text_t){.length = 0, .tag = TEXT_ASCII, .ascii = 0}) + static inline Text_t Text_from_str_literal(const char *str) { return (Text_t){.length = strlen(str), .tag = TEXT_ASCII, .ascii = str}; } @@ -121,7 +123,6 @@ MACROLIKE int32_t Text$get_grapheme(Text_t text, int64_t index) { } extern const TypeInfo_t Text$info; -extern Text_t EMPTY_TEXT; #define Text$metamethods \ { \ |
