summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlly Betts <olly@survex.com>2021-12-13 09:33:26 +1300
committerOlly Betts <olly@survex.com>2021-12-13 09:33:26 +1300
commit4c7febfb80b2c51cae24d9894402000aea909d00 (patch)
treeccfbc6f426343c38a60ea6b42b6dc3fb106a63cc
parent94ad89284d437d83f43623f2970a713d41ee8a0d (diff)
downloadswig-4c7febfb80b2c51cae24d9894402000aea909d00.tar.gz
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 *)`.
-rw-r--r--Source/DOH/doh.h2
1 files changed, 1 insertions, 1 deletions
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