From c9dbb48365bf1a0c5c06daa2234e21e64d9bc2f7 Mon Sep 17 00:00:00 2001 From: Mark Rowe Date: Fri, 13 Feb 2026 18:33:54 -0800 Subject: [DSC] Correctly mark symbols as having local, global, or weak binding --- view/sharedcache/api/python/generator.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'view/sharedcache/api/python/generator.cpp') diff --git a/view/sharedcache/api/python/generator.cpp b/view/sharedcache/api/python/generator.cpp index 81463b51..062f2e27 100644 --- a/view/sharedcache/api/python/generator.cpp +++ b/view/sharedcache/api/python/generator.cpp @@ -331,7 +331,23 @@ int main(int argc, char* argv[]) continue; } - fprintf(out, "%sEnum = ctypes.c_int\n", name.c_str()); + const char* ctypesType = nullptr; + switch (i.second->GetWidth()) + { + case 1: + ctypesType = i.second->IsSigned() ? "ctypes.c_int8" : "ctypes.c_uint8"; + break; + case 2: + ctypesType = i.second->IsSigned() ? "ctypes.c_int16" : "ctypes.c_uint16"; + break; + case 4: + ctypesType = i.second->IsSigned() ? "ctypes.c_int32" : "ctypes.c_uint32"; + break; + default: + ctypesType = i.second->IsSigned() ? "ctypes.c_int64" : "ctypes.c_uint64"; + break; + } + fprintf(out, "%sEnum = %s\n", name.c_str(), ctypesType); fprintf(enums, "\n\nclass %s(enum.IntEnum):\n", name.c_str()); for (auto& j : i.second->GetEnumeration()->GetMembers()) -- cgit v1.3.1