diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-06-10 10:31:43 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-06-10 10:31:43 -0700 |
commit | 8557121c01f072f7e194c93c1e545e0b51ed563d (patch) | |
tree | 86789f4605c1c15e5dc91f3308e7ab10de708066 /ffi.c | |
parent | ec07d15b76092e4fe61198f8d2d9b64d63e2bd23 (diff) | |
download | txr-8557121c01f072f7e194c93c1e545e0b51ed563d.tar.gz txr-8557121c01f072f7e194c93c1e545e0b51ed563d.tar.bz2 txr-8557121c01f072f7e194c93c1e545e0b51ed563d.zip |
ffi: bugfix: string semantics on typedef-d chars.
The problem is that if we have a typedef like (typedef x char)
then (array 256 x) will not do string conversion in the manner
of (array 256 char). This is because the raw syntax is checked
for the symbol char, rather than inspecting the type object.
* ffi.c (ffi_type_compile): When checking whether the array
element is a char, bchar or wchar, look at the syntax in
the compiled type object, not the raw syntax. The compiled
type object is the original type pulled from behind the
typedef alias and has the symbol char, bchar or wchar as
its syntax.
Diffstat (limited to 'ffi.c')
-rw-r--r-- | ffi.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -3068,11 +3068,11 @@ val ffi_type_compile(val syntax) self, syntax, nao); } - if (eltype_syntax == char_s) + if (etft->syntax == char_s) tft->char_conv = 1; - else if (eltype_syntax == wchar_s) + else if (etft->syntax == wchar_s) tft->wchar_conv = 1; - else if (eltype_syntax == bchar_s) + else if (etft->syntax == bchar_s) tft->bchar_conv = 1; return type; } |