From c3c863c7fa2b42fdfae07676b0f183374a08c6b4 Mon Sep 17 00:00:00 2001 From: ryanfleury Date: Sun, 27 Jun 2021 10:19:08 -0600 Subject: [PATCH] c++ build test, add user-defined-literals for metadesk strings --- tests/cpp_build_test.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/cpp_build_test.cpp b/tests/cpp_build_test.cpp index a45abb1..805bda6 100644 --- a/tests/cpp_build_test.cpp +++ b/tests/cpp_build_test.cpp @@ -1,9 +1,16 @@ #include "md.h" #include "md.c" +MD_String8 operator "" _md(const char *s, size_t size) +{ + MD_String8 str = MD_S8((MD_u8 *)s, (MD_u64)size); + return str; +} + int main(void) { - + MD_String8 str = "foobar"_md; + printf("%.*s", MD_StringExpand(str)); return 0; }