From 4c7febfb80b2c51cae24d9894402000aea909d00 Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Mon, 13 Dec 2021 09:33:26 +1300 Subject: [PATCH] Make DOH Char macro more robust For example, `Char(foo)[0]` now works to get the first character of DOH String `foo`. Previously this gave a confusing error because it expanded to `(char *) Data(foo)[0]` and the `[0]` binds more tightly than the `(char *)`. --- Source/DOH/doh.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/DOH/doh.h b/Source/DOH/doh.h index fd0530e9c..a948bc849 100644 --- a/Source/DOH/doh.h +++ b/Source/DOH/doh.h @@ -364,7 +364,7 @@ extern void DohMemoryDebug(void); #define Push(s,x) DohInsertitem(s,DOH_BEGIN,x) #define Len DohLen #define Data DohData -#define Char (char *) Data +#define Char(X) ((char *) Data(X)) #define Cmp DohCmp #define Equal DohEqual #define Setline DohSetline