summaryrefslogtreecommitdiff
path: root/c/_cffi_backend.c
diff options
context:
space:
mode:
Diffstat (limited to 'c/_cffi_backend.c')
-rw-r--r--c/_cffi_backend.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/c/_cffi_backend.c b/c/_cffi_backend.c
index 2ca89be..b92bbe9 100644
--- a/c/_cffi_backend.c
+++ b/c/_cffi_backend.c
@@ -4758,11 +4758,17 @@ static ffi_type *fb_fill_type(struct funcbuilder_s *fb, CTypeDescrObject *ct,
}
return ffistruct;
}
- else {
+ else if (ct->ct_flags & CT_UNION) {
PyErr_Format(PyExc_NotImplementedError,
- "ctype '%s' (size %zd) not supported as %s. "
+ "ctype '%s' not supported as %s. "
"Unions" SUPPORTED_IN_API_MODE,
- ct->ct_name, ct->ct_size, place, place);
+ ct->ct_name, place, place);
+ return NULL;
+ }
+ else {
+ PyErr_Format(PyExc_NotImplementedError,
+ "ctype '%s' (size %zd) not supported as %s",
+ ct->ct_name, ct->ct_size, place);
return NULL;
}
}