Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit632d1aa

Browse files
authored
Don't redefine _Py_NULL macro if already defined (#138)
Original mypy fix by Michael R. Crusoe.
1 parentc84545f commit632d1aa

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

‎pythoncapi_compat.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@ extern "C" {
3737
// Static inline functions should use _Py_NULL rather than using directly NULL
3838
// to prevent C++ compiler warnings. On C23 and newer and on C++11 and newer,
3939
// _Py_NULL is defined as nullptr.
40-
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ > 201710L) \
41-
|| (defined(__cplusplus) && __cplusplus >=201103)
42-
#define_Py_NULLnullptr
43-
#else
44-
#define_Py_NULLNULL
40+
#ifndef _Py_NULL
41+
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ > 201710L) \
42+
|| (defined(__cplusplus) && __cplusplus >=201103)
43+
#define_Py_NULLnullptr
44+
#else
45+
#define_Py_NULLNULL
46+
#endif
4547
#endif
4648

4749
// Cast argument to PyObject* type.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp