Skip to content

Commit

Permalink
Add the void_type definition to tlbparser. (#617)
Browse files Browse the repository at this point in the history
* Add `void_type` to `tlbparser`.

* Replace `void_type` with the symbol defined in `tlbparser`.
  • Loading branch information
junkmd committed Sep 15, 2024
1 parent bcb4ae9 commit c19348c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion comtypes/test/test_typeannotator.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
HRESULT_type,
VARIANT_type,
VARIANT_BOOL_type,
void_type,
)


Expand All @@ -20,7 +21,6 @@
["restricted"],
None,
)
void_type = typedesc.FundamentalType("void", 0, 0)


class Test_AvoidUsingKeywords(unittest.TestCase):
Expand Down
3 changes: 2 additions & 1 deletion comtypes/tools/tlbparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def PTR(typ):
ulonglong_type = typedesc.FundamentalType("long long unsigned int", 64, 64)
float_type = typedesc.FundamentalType("float", 32, 32)
double_type = typedesc.FundamentalType("double", 64, 64)
void_type = typedesc.FundamentalType("void", 0, 0)

# basic COM data types
BSTR_type = typedesc.Typedef("BSTR", PTR(wchar_t_type))
Expand Down Expand Up @@ -89,7 +90,7 @@ def midlSAFEARRAY(typ):
automation.VT_UI8: ulonglong_type, # 21
automation.VT_INT: int_type, # 22
automation.VT_UINT: uint_type, # 23
automation.VT_VOID: typedesc.FundamentalType("void", 0, 0), # 24
automation.VT_VOID: void_type, # 24
automation.VT_HRESULT: HRESULT_type, # 25
automation.VT_LPSTR: PTR(char_type), # 30
automation.VT_LPWSTR: PTR(wchar_t_type), # 31
Expand Down

0 comments on commit c19348c

Please sign in to comment.