summaryrefslogtreecommitdiffstats
path: root/Include
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 /Include
parent41a87637c0406d73425f79ba11aa43dbae9cfe0f (diff)
downloadcpython-fad85aadb0e168b7bde414694e448f34bb38c8ef.zip
cpython-fad85aadb0e168b7bde414694e448f34bb38c8ef.tar.gz
cpython-fad85aadb0e168b7bde414694e448f34bb38c8ef.tar.bz2
Issue #25558: Use compile-time asserts.
Diffstat (limited to 'Include')
-rw-r--r--Include/pymacro.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/Include/pymacro.h b/Include/pymacro.h
index 3f6f5dc..49929e5 100644
--- a/Include/pymacro.h
+++ b/Include/pymacro.h
@@ -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