gh-99069: Consolidate checks for static_assert (GH-94766)
Several platforms don't define the static_assert macro despite having compiler support for the _Static_assert keyword. The macro needs to be defined since it is used unconditionally in the Python code. So it should always be safe to define it if undefined and not in C++11 (or later) mode. Hence, remove the checks for particular platforms or libc versions, and just define static_assert anytime it needs to be defined but isn't. That way, all platforms that need the fix will get it, regardless of whether someone specifically thought of them. Also document that certain macOS versions are among the platforms that need this. The C2x draft (currently expected to become C23) makes static_assert a keyword to match C++. So only define the macro for up to C17. (cherry picked from commit 96e1901a59ed3bb6188743d60395666969a3ba42) Co-authored-by: Joshua Root <jmr@macports.org> Co-authored-by: Victor Stinner <vstinner@python.org>
M
Miss Islington (bot) committed
851e74441e5264bf2bd1383d053de2196e157140
Parent: 09fb27f
Committed by GitHub <noreply@github.com>
on 4/5/2023, 3:44:13 PM