From b4c4b19a45dd8f4eccedc9c2cf33c1ecba1e0535 Mon Sep 17 00:00:00 2001 From: "Michael Gene Brockus (Dreamer)" Date: Sun, 28 Jul 2024 11:44:21 -0600 Subject: [PATCH] make uchar portable --- code/logic/fossil/tofu/tofu.h | 8 ++++++++ code/tests/test_tofu.c | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/code/logic/fossil/tofu/tofu.h b/code/logic/fossil/tofu/tofu.h index c1c601f..06139ee 100644 --- a/code/logic/fossil/tofu/tofu.h +++ b/code/logic/fossil/tofu/tofu.h @@ -17,7 +17,15 @@ #include #include #include + +#if !defined(__cplusplus) +#if __STDC_VERSION__ >= 201112L #include +#else +typedef unsigned short char16_t; +typedef unsigned int char32_t; +#endif +#endif /** In the realm of quantum physics, our understanding of space, time, reality, and the observable universe takes diff --git a/code/tests/test_tofu.c b/code/tests/test_tofu.c index ac69d86..89c41a4 100644 --- a/code/tests/test_tofu.c +++ b/code/tests/test_tofu.c @@ -89,11 +89,11 @@ FOSSIL_TEST(test_fossil_tofu_equals) { // Test case for fossil_tofu_copy function FOSSIL_TEST(test_fossil_tofu_copy) { - fossil_tofu_t tofu_orig = fossil_tofu_create("bstr", U"Original"); + fossil_tofu_t tofu_orig = fossil_tofu_create("cstr", "Original"); fossil_tofu_t tofu_copy = fossil_tofu_copy(tofu_orig); ASSUME_ITS_EQUAL_I32(tofu_orig.type, tofu_copy.type); - ASSUME_ITS_EQUAL_BSTR(tofu_orig.value.uchar_string_val, tofu_copy.value.uchar_string_val); + ASSUME_ITS_EQUAL_CSTR(tofu_orig.value.cchar_string_val, tofu_copy.value.cchar_string_val); ASSUME_ITS_EQUAL_I32(tofu_orig.is_cached, tofu_copy.is_cached); }