From ae810eddac216549f11ec096b2b9c417eb740cb3 Mon Sep 17 00:00:00 2001 From: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Date: Wed, 25 Jun 2025 21:15:43 +0800 Subject: [PATCH 1/2] Fix MSVC Clatest C builds --- Include/pymacro.h | 4 ++-- Include/pyport.h | 3 ++- Modules/mathmodule.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Include/pymacro.h b/Include/pymacro.h index bfe660e8303d0f..b2886ddac5d17e 100644 --- a/Include/pymacro.h +++ b/Include/pymacro.h @@ -73,14 +73,14 @@ # else # define _Py_ALIGNED_DEF(N, T) alignas(N) alignas(T) T # endif +# elif defined(_MSC_VER) +# define _Py_ALIGNED_DEF(N, T) __declspec(align(N)) T # elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L # define _Py_ALIGNED_DEF(N, T) alignas(N) alignas(T) T # elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L # define _Py_ALIGNED_DEF(N, T) _Alignas(N) _Alignas(T) T # elif (defined(__GNUC__) || defined(__clang__)) # define _Py_ALIGNED_DEF(N, T) __attribute__((aligned(N))) T -# elif defined(_MSC_VER) -# define _Py_ALIGNED_DEF(N, T) __declspec(align(N)) T # else # define _Py_ALIGNED_DEF(N, T) _Alignas(N) _Alignas(T) T # endif diff --git a/Include/pyport.h b/Include/pyport.h index 3eac119bf8e8d8..73f071c41a6687 100644 --- a/Include/pyport.h +++ b/Include/pyport.h @@ -49,7 +49,8 @@ // Static inline functions should use _Py_NULL rather than using directly NULL // to prevent C++ compiler warnings. On C23 and newer and on C++11 and newer, // _Py_NULL is defined as nullptr. -#if (defined (__STDC_VERSION__) && __STDC_VERSION__ > 201710L) \ +#if (defined(__GNUC__) || defined(__clang__)) && \ + (defined (__STDC_VERSION__) && __STDC_VERSION__ > 201710L) \ || (defined(__cplusplus) && __cplusplus >= 201103) # define _Py_NULL nullptr #else diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c index bbbb49115681de..1837de4735c176 100644 --- a/Modules/mathmodule.c +++ b/Modules/mathmodule.c @@ -3148,7 +3148,7 @@ static PyObject * math_issubnormal_impl(PyObject *module, double x) /*[clinic end generated code: output=4e76ac98ddcae761 input=9a20aba7107d0d95]*/ { -#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L +#if !defined(_MSC_VER) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L return PyBool_FromLong(issubnormal(x)); #else return PyBool_FromLong(isfinite(x) && x && !isnormal(x)); From 08110b0bdffefcaa59c8f8788be02888604082e0 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Wed, 25 Jun 2025 13:27:21 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../next/Build/2025-06-25-13-27-14.gh-issue-135927.iCNPQc.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Build/2025-06-25-13-27-14.gh-issue-135927.iCNPQc.rst diff --git a/Misc/NEWS.d/next/Build/2025-06-25-13-27-14.gh-issue-135927.iCNPQc.rst b/Misc/NEWS.d/next/Build/2025-06-25-13-27-14.gh-issue-135927.iCNPQc.rst new file mode 100644 index 00000000000000..21a2c87d3448c1 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2025-06-25-13-27-14.gh-issue-135927.iCNPQc.rst @@ -0,0 +1 @@ +Fix building with MSVC when passing option ``/std:clatest``. 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