Buckets:
| // gh-91782: On FreeBSD 12, if the _POSIX_C_SOURCE and _XOPEN_SOURCE macros are | |
| // defined, <sys/cdefs.h> disables C11 support and <assert.h> does not define | |
| // the static_assert() macro. | |
| // https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255290 | |
| // | |
| // macOS <= 10.10 doesn't define static_assert in assert.h at all despite | |
| // having C11 compiler support. | |
| // | |
| // static_assert is defined in glibc from version 2.16. Compiler support for | |
| // the C11 _Static_assert keyword is in gcc >= 4.6. | |
| // | |
| // MSVC makes static_assert a keyword in C11-17, contrary to the standards. | |
| // | |
| // In C++11 and C2x, static_assert is a keyword, redefining is undefined | |
| // behaviour. So only define if building as C, not C++ (if __cplusplus is | |
| // not defined), and only for C11-17. | |
| /* Minimum value between x and y */ | |
| /* Maximum value between x and y */ | |
| /* Absolute value of the number x */ | |
| /* Safer implementation that avoids an undefined behavior for the minimal | |
| value of the signed integer type if its absolute value is larger than | |
| the maximal value of the signed integer type (in the two's complement | |
| representations, which is common). | |
| */ | |
| /* Convert the argument to a string. For example, Py_STRINGIFY(123) is replaced | |
| with "123" by the preprocessor. Defines are also replaced by their value. | |
| For example Py_STRINGIFY(__LINE__) is replaced by the line number, not | |
| by "__LINE__". */ | |
| /* Get the size of a structure member in bytes */ | |
| /* Argument must be a char or an int in [-128, 127] or [0, 255]. */ | |
| /* Assert a build-time dependency, as an expression. | |
| * | |
| * Your compile will fail if the condition isn't true, or can't be evaluated | |
| * by the compiler. This can be used in an expression: its value is 0. | |
| * | |
| * Example: | |
| * | |
| * #define foo_to_char(foo) \ | |
| * ((char *)(foo) \ | |
| * + Py_BUILD_ASSERT_EXPR(offsetof(struct foo, string) == 0)) | |
| * | |
| * Written by Rusty Russell, public domain, http://ccodearchive.net/ | |
| */ | |
| // Use static_assert() on C11 and newer | |
| /* Get the number of elements in a visible array | |
| This does not work on pointers, or arrays declared as [], or function | |
| parameters. With correct compiler support, such usage will cause a build | |
| error (see Py_BUILD_ASSERT_EXPR). | |
| Written by Rusty Russell, public domain, http://ccodearchive.net/ | |
| Requires at GCC 3.1+ */ | |
| /* Two gcc extensions. | |
| &a[0] degrades to a pointer: a different type from an array */ | |
| /* Define macros for inline documentation. */ | |
| /* Below "a" is a power of 2. */ | |
| /* Round down size "n" to be a multiple of "a". */ | |
| /* Round up size "n" to be a multiple of "a". */ | |
| /* Round pointer "p" down to the closest "a"-aligned address <= "p". */ | |
| /* Round pointer "p" up to the closest "a"-aligned address >= "p". */ | |
| /* Check if pointer "p" is aligned to "a"-bytes boundary. */ | |
| /* Use this for unused arguments in a function definition to silence compiler | |
| * warnings. Example: | |
| * | |
| * int func(int a, int Py_UNUSED(b)) { return a; } | |
| */ | |
| // Disable warning C4100: unreferenced formal parameter, | |
| // declare the parameter, | |
| // restore old compiler warnings. | |
| // Prevent using an expression as a l-value. | |
| // For example, "int x; _Py_RVALUE(x) = 1;" fails with a compiler error. | |
| // Return non-zero if the type is signed, return zero if it's unsigned. | |
| // Use "<= 0" rather than "< 0" to prevent the compiler warning: | |
| // "comparison of unsigned expression in '< 0' is always false". | |
Xet Storage Details
- Size:
- 7.7 kB
- Xet hash:
- 260853d24413c7833f876c7627b7ec42ad7da52c1fd6bf191f06f1fdc9e0523b
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.