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 *)`.
This commit is contained in:
Olly Betts 2021-12-13 09:33:26 +13:00
commit 4c7febfb80

View file

@ -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