Issue #25558: Use compile-time asserts.

This commit is contained in:
Serhiy Storchaka 2015-11-07 15:42:38 +02:00
parent 41a87637c0
commit fad85aadb0
7 changed files with 24 additions and 20 deletions

View file

@ -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