diff options
| author | Mark Rowe <mark@vector35.com> | 2026-02-13 18:33:54 -0800 |
|---|---|---|
| committer | Mark Rowe <mark@vector35.com> | 2026-02-13 19:42:13 -0800 |
| commit | c9dbb48365bf1a0c5c06daa2234e21e64d9bc2f7 (patch) | |
| tree | dd476df611f5d74590d48afb869896670a8f560c /view/sharedcache/api/python/generator.cpp | |
| parent | e2feac85c58785640a2760f137a44c08ef953931 (diff) | |
[DSC] Correctly mark symbols as having local, global, or weak binding
Diffstat (limited to 'view/sharedcache/api/python/generator.cpp')
| -rw-r--r-- | view/sharedcache/api/python/generator.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
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()) |
