From 3354560c7b5bf8363779aed4cc7d5fc5077afa56 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Sun, 26 Jan 2025 12:59:19 +0100 Subject: [PATCH] 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. --- pythoncapi_compat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pythoncapi_compat.h b/pythoncapi_compat.h index 8cf63f5..4d28846 100644 --- a/pythoncapi_compat.h +++ b/pythoncapi_compat.h @@ -2092,7 +2092,7 @@ PyConfig_Get(const char *name) const PyConfigSpec *spec; int found = 0; - for (size_t i=0; i < Py_ARRAY_LENGTH(config_spec); i++) { + for (size_t i=0; i < sizeof(config_spec) / sizeof(config_spec[0]); i++) { spec = &config_spec[i]; if (strcmp(spec->name, name) == 0) { found = 1; pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy