summaryrefslogtreecommitdiffstats
path: root/Modules/_datetimemodule.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-11-07 13:42:38 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-11-07 13:42:38 (GMT)
commitfad85aadb0e168b7bde414694e448f34bb38c8ef (patch)
treef8fd61aa10789d9bda57c33d66ff4e60bd4d2794 /Modules/_datetimemodule.c
parent41a87637c0406d73425f79ba11aa43dbae9cfe0f (diff)
downloadcpython-fad85aadb0e168b7bde414694e448f34bb38c8ef.zip
cpython-fad85aadb0e168b7bde414694e448f34bb38c8ef.tar.gz
cpython-fad85aadb0e168b7bde414694e448f34bb38c8ef.tar.bz2
Issue #25558: Use compile-time asserts.
Diffstat (limited to 'Modules/_datetimemodule.c')
-rw-r--r--Modules/_datetimemodule.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c
index 94336cf..55988c5 100644
--- a/Modules/_datetimemodule.c
+++ b/Modules/_datetimemodule.c
@@ -5329,19 +5329,19 @@ PyInit__datetime(void)
/* A 4-year cycle has an extra leap day over what we'd get from
* pasting together 4 single years.
*/
- assert(DI4Y == 4 * 365 + 1);
+ Py_BUILD_ASSERT(DI4Y == 4 * 365 + 1);
assert(DI4Y == days_before_year(4+1));
/* Similarly, a 400-year cycle has an extra leap day over what we'd
* get from pasting together 4 100-year cycles.
*/
- assert(DI400Y == 4 * DI100Y + 1);
+ Py_BUILD_ASSERT(DI400Y == 4 * DI100Y + 1);
assert(DI400Y == days_before_year(400+1));
/* OTOH, a 100-year cycle has one fewer leap day than we'd get from
* pasting together 25 4-year cycles.
*/
- assert(DI100Y == 25 * DI4Y - 1);
+ Py_BUILD_ASSERT(DI100Y == 25 * DI4Y - 1);
assert(DI100Y == days_before_year(100+1));
one = PyLong_FromLong(1);