https://github.com/python/cpython/commit/40cc809902304f60c6e1c933191dd4d64e570e28
commit: 40cc809902304f60c6e1c933191dd4d64e570e28
branch: main
author: Guido van Rossum <[email protected]>
committer: gvanrossum <[email protected]>
date: 2024-05-05T19:28:55Z
summary:
gh-117549: Don't use designated initializers in headers (#118580)
The designated initializer syntax in static inline functions in pycore_backoff.h
causes problems for C++ or MSVC users who aren't yet using C++20.
While internal, pycore_backoff.h is included (indirectly, via pycore_code.h)
by some key 3rd party software that does so for speed.
files:
A Misc/NEWS.d/next/Core and
Builtins/2024-05-05-12-04-02.gh-issue-117549.kITawD.rst
M Include/internal/pycore_backoff.h
diff --git a/Include/internal/pycore_backoff.h
b/Include/internal/pycore_backoff.h
index decf92bc419c04..90735b202c7a93 100644
--- a/Include/internal/pycore_backoff.h
+++ b/Include/internal/pycore_backoff.h
@@ -44,13 +44,18 @@ make_backoff_counter(uint16_t value, uint16_t backoff)
{
assert(backoff <= 15);
assert(value <= 0xFFF);
- return (_Py_BackoffCounter){.backoff = backoff, .value = value};
+ _Py_BackoffCounter result;
+ result.value = value;
+ result.backoff = backoff;
+ return result;
}
static inline _Py_BackoffCounter
forge_backoff_counter(uint16_t counter)
{
- return (_Py_BackoffCounter){.as_counter = counter};
+ _Py_BackoffCounter result;
+ result.as_counter = counter;
+ return result;
}
static inline _Py_BackoffCounter
diff --git a/Misc/NEWS.d/next/Core and
Builtins/2024-05-05-12-04-02.gh-issue-117549.kITawD.rst b/Misc/NEWS.d/next/Core
and Builtins/2024-05-05-12-04-02.gh-issue-117549.kITawD.rst
new file mode 100644
index 00000000000000..48ca1693a6a365
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and
Builtins/2024-05-05-12-04-02.gh-issue-117549.kITawD.rst
@@ -0,0 +1,5 @@
+Don't use designated initializer syntax in inline functions in internal
+headers. They cause problems for C++ or MSVC users who aren't yet using the
+latest C++ standard (C++20). While internal, pycore_backoff.h, is included
+(indirectly, via pycore_code.h) by some key 3rd party software that does so
+for speed.
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]