From 8ee23054bf771e56802ce21d70229b7f8f2e9654 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 15 Sep 2024 17:34:34 -0400 Subject: Update Inline C syntax and documentation/tests --- examples/log.tm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'examples/log.tm') diff --git a/examples/log.tm b/examples/log.tm index 24397c90..42df072c 100644 --- a/examples/log.tm +++ b/examples/log.tm @@ -6,15 +6,13 @@ timestamp_format := CString("%F %T") logfiles := {:Path} func _timestamp()->Text: - c_str := inline C ( - ({ + c_str := inline C:CString { char *str = GC_MALLOC_ATOMIC(20); time_t t; time(&t); struct tm *tm_info = localtime(&t); strftime(str, 20, "%F %T", tm_info); - str; - }) - ) : CString + str + } return c_str:as_text() func info(text:Text, newline=yes): -- cgit v1.2.3