summaryrefslogtreecommitdiffstats
path: root/Modules/_pickle.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-04-20 17:26:40 (GMT)
committerGitHub <noreply@github.com>2022-04-20 17:26:40 (GMT)
commit7cdaf87ec50f76c934ba651256484c4624b84ef2 (patch)
tree64ce3dcd176b6c0397f901f28e5406e3eca12588 /Modules/_pickle.c
parentad3ca17ff5cd63f907430073b52be27695674148 (diff)
downloadcpython-7cdaf87ec50f76c934ba651256484c4624b84ef2.zip
cpython-7cdaf87ec50f76c934ba651256484c4624b84ef2.tar.gz
cpython-7cdaf87ec50f76c934ba651256484c4624b84ef2.tar.bz2
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.
Diffstat (limited to 'Modules/_pickle.c')
-rw-r--r--Modules/_pickle.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_pickle.c b/Modules/_pickle.c
index a5595eb..7a8c9ed 100644
--- a/Modules/_pickle.c
+++ b/Modules/_pickle.c
@@ -964,7 +964,7 @@ _write_size64(char *out, size_t value)
{
size_t i;
- Py_BUILD_ASSERT(sizeof(size_t) <= 8);
+ static_assert(sizeof(size_t) <= 8, "size_t is larger than 64-bit");
for (i = 0; i < sizeof(size_t); i++) {
out[i] = (unsigned char)((value >> (8 * i)) & 0xff);