]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-91731: Replace Py_BUILD_ASSERT() with static_assert() (#91730)
authorVictor Stinner <vstinner@python.org>
Wed, 20 Apr 2022 17:26:40 +0000 (19:26 +0200)
committerGitHub <noreply@github.com>
Wed, 20 Apr 2022 17:26:40 +0000 (19:26 +0200)
commit7cdaf87ec50f76c934ba651256484c4624b84ef2
tree64ce3dcd176b6c0397f901f28e5406e3eca12588
parentad3ca17ff5cd63f907430073b52be27695674148
gh-91731: Replace Py_BUILD_ASSERT() with static_assert() (#91730)

Python 3.11 now uses C11 standard which adds static_assert()
to <assert.h>.

* In pytime.c, replace Py_BUILD_ASSERT() with preprocessor checks on
  SIZEOF_TIME_T with #error.
* On macOS, py_mach_timebase_info() now accepts timebase members with
  the same size than _PyTime_t.
* py_get_monotonic_clock() now saturates GetTickCount64() to
  _PyTime_MAX: GetTickCount64() is unsigned, whereas _PyTime_t is
  signed.
Modules/_datetimemodule.c
Modules/_pickle.c
Modules/_testcapimodule.c
Modules/posixmodule.c
Modules/pyexpat.c
Objects/longobject.c
Objects/sliceobject.c
Python/fileutils.c
Python/initconfig.c
Python/pytime.c