Changeset View
Changeset View
Standalone View
Standalone View
intern/atomic/intern/atomic_ops_utils.h
| Show First 20 Lines • Show All 100 Lines • ▼ Show 20 Lines | |||||
| # define LG_SIZEOF_INT 8 | # define LG_SIZEOF_INT 8 | ||||
| #else | #else | ||||
| # error "Cannot find int size" | # error "Cannot find int size" | ||||
| #endif | #endif | ||||
| /* Copied from BLI_utils... */ | /* Copied from BLI_utils... */ | ||||
| /* C++ can't use _Static_assert, expects static_assert() but c++0x only, | /* C++ can't use _Static_assert, expects static_assert() but c++0x only, | ||||
| * Coverity also errors out. */ | * Coverity also errors out. */ | ||||
| #if (!defined(__cplusplus)) && (!defined(__COVERITY__)) && \ | #if (!defined(__cplusplus)) && (!defined(__COVERITY__)) && (defined(__GNUC__)) /* GCC only. */ | ||||
| (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 406)) /* gcc4.6+ only */ | |||||
| # define ATOMIC_STATIC_ASSERT(a, msg) __extension__ _Static_assert(a, msg); | # define ATOMIC_STATIC_ASSERT(a, msg) __extension__ _Static_assert(a, msg); | ||||
| #else | #else | ||||
| /* Code adapted from http://www.pixelbeat.org/programming/gcc/static_assert.html */ | /* Code adapted from http://www.pixelbeat.org/programming/gcc/static_assert.html */ | ||||
| /* Note we need the two concats below because arguments to ## are not expanded, so we need to | /* Note we need the two concats below because arguments to ## are not expanded, so we need to | ||||
| * expand __LINE__ with one indirection before doing the actual concatenation. */ | * expand __LINE__ with one indirection before doing the actual concatenation. */ | ||||
| # define ATOMIC_ASSERT_CONCAT_(a, b) a##b | # define ATOMIC_ASSERT_CONCAT_(a, b) a##b | ||||
| # define ATOMIC_ASSERT_CONCAT(a, b) ATOMIC_ASSERT_CONCAT_(a, b) | # define ATOMIC_ASSERT_CONCAT(a, b) ATOMIC_ASSERT_CONCAT_(a, b) | ||||
| /* These can't be used after statements in c89. */ | /* These can't be used after statements in c89. */ | ||||
| Show All 16 Lines | |||||