aboutsummaryrefslogtreecommitdiff
path: root/nextlang.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-02-10 15:33:35 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-02-10 15:33:35 -0500
commit2c9ee0c629834bea159f033db2d9a42a4f8110a2 (patch)
treeea5cc103996a64b7c34355a7b138b8fa28ac1b50 /nextlang.h
parent4e545c67985299dabc2a061160e126068d43541e (diff)
String improvements
Diffstat (limited to 'nextlang.h')
-rw-r--r--nextlang.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/nextlang.h b/nextlang.h
index 2e55b1cf..2718ef6d 100644
--- a/nextlang.h
+++ b/nextlang.h
@@ -31,11 +31,13 @@
#define CORD_asprintf(...) ({ CORD __c; CORD_sprintf(&__c, __VA_ARGS__); __c; })
#define __declare(var, val) __typeof(val) var = val
#define __cord(x) _Generic(x, bool: x ? "yes" : "no", \
- int8_t: CORD_asprintf("%d", x), int16_t: CORD_asprintf("%d", x), \
+ int8_t: CORD_asprintf("%d", x), \
+ int16_t: CORD_asprintf("%d", x), \
int32_t: CORD_asprintf("%d", x), int64_t: CORD_asprintf("%ld", x), \
double: CORD_asprintf("%g", x), float: CORD_asprintf("%g", x), \
CORD: x, \
char*: x, \
+ char: CORD_cat_char(NULL, x), \
default: "???")
#define __heap(x) (__typeof(x)*)memcpy(GC_MALLOC(sizeof(x)), (__typeof(x)[1]){x}, sizeof(x))
#define __stack(x) (&(__typeof(x)){x})