Commit 1ce05b86 authored by Stefan Behnel's avatar Stefan Behnel

Refactor function to make it less verbose and simpler to change: error cases...

Refactor function to make it less verbose and simpler to change: error cases first, then special cases, then normal behaviour.
parent 8e1bfe7f
...@@ -389,19 +389,14 @@ def public_decl(base_code, dll_linkage): ...@@ -389,19 +389,14 @@ def public_decl(base_code, dll_linkage):
else: else:
return base_code return base_code
def create_typedef_type(name, base_type, cname, is_external=0, namespace=None): def create_typedef_type(name, base_type, cname, is_external=0, namespace=None):
is_fused = base_type.is_fused
if base_type.is_complex or is_fused:
if is_external: if is_external:
if is_fused: if base_type.is_complex or base_type.is_fused:
msg = "Fused" raise ValueError("%s external typedefs not supported" % (
else: "Fused" if base_type.is_fused else "Complex"))
msg = "Complex" if base_type.is_complex or base_type.is_fused:
raise ValueError("%s external typedefs not supported" % msg)
return base_type return base_type
else:
return CTypedefType(name, base_type, cname, is_external, namespace) return CTypedefType(name, base_type, cname, is_external, namespace)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment