Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/util/util_static_assert.h
| Show All 18 Lines | |||||
| /* #define static_assert triggers a bug in some clang-format versions, disable | /* #define static_assert triggers a bug in some clang-format versions, disable | ||||
| * format for entire file to keep results consistent. */ | * format for entire file to keep results consistent. */ | ||||
| #ifndef __UTIL_STATIC_ASSERT_H__ | #ifndef __UTIL_STATIC_ASSERT_H__ | ||||
| #define __UTIL_STATIC_ASSERT_H__ | #define __UTIL_STATIC_ASSERT_H__ | ||||
| CCL_NAMESPACE_BEGIN | CCL_NAMESPACE_BEGIN | ||||
| #if defined(__KERNEL_OPENCL__) || defined(CYCLES_CUBIN_CC) | #if defined(CYCLES_CUBIN_CC) | ||||
| # define static_assert(statement, message) | # define static_assert(statement, message) | ||||
| #endif /* __KERNEL_OPENCL__ */ | #endif | ||||
| #define static_assert_align(st, align) \ | #define static_assert_align(st, align) \ | ||||
| static_assert((sizeof(st) % (align) == 0), "Structure must be strictly aligned") // NOLINT | static_assert((sizeof(st) % (align) == 0), "Structure must be strictly aligned") // NOLINT | ||||
| CCL_NAMESPACE_END | CCL_NAMESPACE_END | ||||
| #endif /* __UTIL_STATIC_ASSERT_H__ */ | #endif /* __UTIL_STATIC_ASSERT_H__ */ | ||||