File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 1717
1818 #define foo_to_char(foo) \
1919 ((char *)(foo) \
20- + Py_BUILD_ASSERT (offsetof(struct foo, string) == 0))
20+ + Py_BUILD_ASSERT_EXPR (offsetof(struct foo, string) == 0))
2121
2222 Written by Rusty Russell, public domain, http://ccodearchive.net/ */
23- #define Py_BUILD_ASSERT (cond ) \
23+ #define Py_BUILD_ASSERT_EXPR (cond ) \
2424 (sizeof(char [1 - 2*!(cond)]) - 1)
2525
26-
2726/* Get the number of elements in a visible array
2827
2928 This does not work on pointers, or arrays declared as [], or function
3029 parameters. With correct compiler support, such usage will cause a build
31- error (see Py_BUILD_ASSERT ).
30+ error (see Py_BUILD_ASSERT_EXPR ).
3231
3332 Written by Rusty Russell, public domain, http://ccodearchive.net/ */
3433#if defined(__GNUC__ )
3534/* Two gcc extensions.
3635 &a[0] degrades to a pointer: a different type from an array */
3736#define Py_ARRAY_LENGTH (array ) \
3837 (sizeof(array) / sizeof((array)[0]) \
39- + Py_BUILD_ASSERT (!__builtin_types_compatible_p(typeof(array), \
40- typeof(&(array)[0]))))
38+ + Py_BUILD_ASSERT_EXPR (!__builtin_types_compatible_p(typeof(array), \
39+ typeof(&(array)[0]))))
4140#else
4241#define Py_ARRAY_LENGTH (array ) \
4342 (sizeof(array) / sizeof((array)[0]))
You can’t perform that action at this time.
0 commit comments