mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
Issue #25558: Use compile-time asserts.
This commit is contained in:
parent
41a87637c0
commit
fad85aadb0
7 changed files with 24 additions and 20 deletions
|
@ -36,6 +36,10 @@
|
|||
#define Py_BUILD_ASSERT_EXPR(cond) \
|
||||
(sizeof(char [1 - 2*!(cond)]) - 1)
|
||||
|
||||
#define Py_BUILD_ASSERT(cond) do { \
|
||||
(void)Py_BUILD_ASSERT_EXPR(cond); \
|
||||
} while(0)
|
||||
|
||||
/* Get the number of elements in a visible array
|
||||
|
||||
This does not work on pointers, or arrays declared as [], or function
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue