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.
{
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
--- /dev/null
+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.