Commit Graph

14 Commits

Author SHA1 Message Date
Barry Warsaw b2e5794870 bpo-31338 (#3374)
* Add Py_UNREACHABLE() as an alias to abort().
* Use Py_UNREACHABLE() instead of assert(0)
* Convert more unreachable code to use Py_UNREACHABLE()
* Document Py_UNREACHABLE() and a few other macros.
2017-09-14 18:13:16 -07:00
Niklas Fiekas 83371f4f7f bpo-29936: fix typo __GNU*C*_MINOR__ (#878) 2017-03-28 21:58:01 -07:00
Victor Stinner 98ee9d5b73 Add Py_MEMBER_SIZE macro
Issue #27350: use Py_MEMBER_SIZE() macro to get the size of
PyDictKeyEntry.dk_indices, rather than hardcoding 8.
2016-09-08 09:33:56 -07:00
Benjamin Peterson ca47063998 replace Py_(u)intptr_t with the c99 standard types 2016-09-06 13:47:26 -07:00
Serhiy Storchaka fad85aadb0 Issue #25558: Use compile-time asserts. 2015-11-07 15:42:38 +02:00
Victor Stinner 45e8e2f218 Issue #21490: Add new C macros: Py_ABS() and Py_STRINGIFY()
Keep _Py_STRINGIZE() in PC/pyconfig.h to not introduce a dependency between
pyconfig.h and pymacros.h.
2014-05-14 17:24:35 +02:00
Larry Hastings 3cceb38486 Issue #19976: Argument Clinic METH_NOARGS functions now always
take two parameters.
2014-01-04 11:09:09 -08:00
Christian Heimes e0a2d12ee5 Fix test for GCC 3.1+ but not strict ANSI C 2013-06-24 15:39:41 +02:00
Christian Heimes 61dbb00869 Issue #16881: Fix Py_ARRAY_LENGTH macro for GCC < 3.1. 2013-01-06 16:41:56 +01:00
Christian Heimes fd0ddab97b GCC doesn't support typeof in strict ansi mode (e.g. -ansi or -std=c89) 2012-09-23 16:15:01 +02:00
Antoine Pitrou ca8aa4acf6 Issue #15144: Fix possible integer overflow when handling pointers as integer values, by using Py_uintptr_t instead of size_t.
Patch by Serhiy Storchaka.
2012-09-20 20:56:47 +02:00
Victor Stinner f0ddadcf2e Rename Py_BUILD_ASSERT to Py_BUILD_ASSERT_EXPR
To make it clearer that Py_BUILD_ASSERT_EXPR(cond) cannot be used as
assert(cond).
2011-09-29 12:43:18 +02:00
Victor Stinner 573696a9ca pymacro.h: Inline _Py_ARRAY_LENGTH_CHECK() and add http://ccodearchive.net/ 2011-09-29 12:12:39 +02:00
Victor Stinner dfb866d127 Enhance Py_ARRAY_LENGTH(): fail at build time if the argument is not an array
Move other various macros to pymcacro.h

Thanks Rusty Russell for having written these amazing C macros!
2011-09-29 01:12:24 +02:00