From 559902eaf56a20de6be981d235b6ba303e814b2e Mon Sep 17 00:00:00 2001 From: Timerix Date: Sun, 21 Dec 2025 20:00:26 +0500 Subject: [PATCH] updated tlibc --- README.md | 4 +++- project.config | 3 +-- src/TomlTable.c | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0489787..c17ed9b 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,8 @@ A fork of [libtoml](https://github.com/brglng/libtoml) rewritten to use [tlibc]( 5. To build library use tasks `build_static_lib[_dbg]` or `build_shared_lib[_dbg]` +6. If you use tlibtoml as static library, add `LINKER_LIBS` from tlibtoml `project.config` to your project. + ## Usage ```c @@ -46,7 +48,7 @@ int main(){ // get value by key and ensure it's a string try_fatal(str* s, p, TomlTable_get_str(t, STR("some_key"))); // print this string value - printf("some_key = '"FMT_str"'\n", str_expand(*s)); + printf("some_key = '"FMT_str"'\n", str_unwrap(*s)); Return 0; // call defers } diff --git a/project.config b/project.config index a950c2f..a497341 100644 --- a/project.config +++ b/project.config @@ -45,8 +45,7 @@ case "$OS" in EXEC_FILE="test.exe" SHARED_LIB_FILE="$PROJECT.dll" INCLUDE="$INCLUDE " - # example: "-lSDL2 -lSDL2_image" - LINKER_LIBS="" + LINKER_LIBS="-luuid" ;; LINUX) EXEC_FILE="test" diff --git a/src/TomlTable.c b/src/TomlTable.c index 9e1b95a..636222c 100644 --- a/src/TomlTable.c +++ b/src/TomlTable.c @@ -25,7 +25,7 @@ void TomlTable_free(TomlTable* self) Return RESULT_ERROR_CODE_FMT( \ TLIBTOML, TLIBTOML_ERR_NOT_FOUND, \ "can't find '"FMT_str"'", \ - str_expand(KEY)); \ + str_unwrap(KEY)); \ } \ #define try_assert_value_type(VAL, KEY, TYPE) \ @@ -35,7 +35,7 @@ void TomlTable_free(TomlTable* self) Return RESULT_ERROR_CODE_FMT( \ TLIBTOML, TLIBTOML_ERR_UNEXPECTED_TYPE, \ "expected '"FMT_str"' of type '"FMT_str"', but got '"FMT_str"'", \ - str_expand(KEY), str_expand(t_expected_s), str_expand(t_got_s)); \ + str_unwrap(KEY), str_unwrap(t_expected_s), str_unwrap(t_got_s)); \ } \ Result(TomlTable*) TomlTable_get_table(const TomlTable* self, str key)