Skip to content

Commit 30d73ce

Browse files
fix: windows build (uint16_t -> unsigned short)
1 parent aa79fdb commit 30d73ce

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

generate_cffi_definitions.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -628,8 +628,9 @@ def fix_windows_type_compatibility(cdef_content):
628628
# Target simple field declarations in structs
629629
(r"(\s+)uint8_t\s+(\w+);", r"\1char \2;"),
630630
(r"(\s+)int8_t\s+(\w+);", r"\1char \2;"),
631-
# Target uint16_t fields in structs for Windows compatibility (not function parameters)
632-
(r"^(\s+)uint16_t\s+(\w+);", r"\1unsigned int \2;"),
631+
# Target uint16_t fields in structs for Windows compatibility
632+
# (not function parameters)
633+
(r"^(\s+)uint16_t\s+(\w+);", r"\1unsigned short \2;"),
633634
]
634635

635636
for pattern, replacement in replacements:
@@ -639,7 +640,7 @@ def fix_windows_type_compatibility(cdef_content):
639640

640641
print(
641642
"Converted specific uint8_t, int8_t, and uint16_t fields to "
642-
"char and unsigned int for Windows CFFI compatibility"
643+
"char and unsigned short for Windows CFFI compatibility"
643644
)
644645
else:
645646
print("Non-Windows platform - keeping original types")

0 commit comments

Comments
 (0)