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

Commit3354560

Browse files
committed
Avoid Py_ARRAY_LENGTH()
Replace Py_ARRAY_LENGTH(array) with sizeof(array)/sizeof(array[0]).Py_ARRAY_LENGTH() fails with C++ on Python 3.9 on macOS.
1 parentd341dac commit3354560

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎pythoncapi_compat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2092,7 +2092,7 @@ PyConfig_Get(const char *name)
20922092

20932093
const PyConfigSpec *spec;
20942094
int found =0;
2095-
for (size_t i=0; i <Py_ARRAY_LENGTH(config_spec); i++) {
2095+
for (size_t i=0; i <sizeof(config_spec) /sizeof(config_spec[0]); i++) {
20962096
spec = &config_spec[i];
20972097
if (strcmp(spec->name, name) ==0) {
20982098
found =1;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp