Skip to content

Commit 858c9a5

Browse files
authored
gh-95417: Quick fix for "ULONG_PTR differs in levels of indirection from void *" (GH-95538)
1 parent c0cd790 commit 858c9a5

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

Modules/clinic/overlapped.c.h

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/overlapped.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,21 @@ class HANDLE_converter(pointer_converter):
5252
class ULONG_PTR_converter(pointer_converter):
5353
type = 'ULONG_PTR'
5454
55+
def parse_arg(self, argname, displayname):
56+
return """
57+
{paramname} = (uintptr_t)PyLong_AsVoidPtr({argname});
58+
if (!{paramname} && PyErr_Occurred()) {{{{
59+
goto exit;
60+
}}}}
61+
""".format(argname=argname, paramname=self.parser_name)
62+
5563
class DWORD_converter(unsigned_long_converter):
5664
type = 'DWORD'
5765
5866
class BOOL_converter(int_converter):
5967
type = 'BOOL'
6068
[python start generated code]*/
61-
/*[python end generated code: output=da39a3ee5e6b4b0d input=a19133a9e14fae9c]*/
69+
/*[python end generated code: output=da39a3ee5e6b4b0d input=8a07ea3018f4cec8]*/
6270

6371
/*[clinic input]
6472
module _overlapped

0 commit comments

Comments
 (0)