|
@@ -1,12 +1,10 @@
|
|
|
#ifndef CORE_ALIGNED_DATA_HPP
|
|
|
#define CORE_ALIGNED_DATA_HPP
|
|
|
|
|
|
-#define alignmentof(type) __alignof__(type)
|
|
|
-
|
|
|
#define CORE_ASSERT_ALIGNED_DATA(var, type) \
|
|
|
static_assert(sizeof(var) == sizeof(type), "aligned data size missmatch"); \
|
|
|
static_assert(var.getSize() >= var.getAlignment(), "size >= alignment"); \
|
|
|
- static_assert(alignmentof(var) == alignmentof(type), \
|
|
|
+ static_assert(alignof(decltype(var)) == alignof(type), \
|
|
|
"aligned data alignment missmatch");
|
|
|
|
|
|
namespace Core {
|
|
@@ -36,7 +34,7 @@ namespace Core {
|
|
|
};
|
|
|
|
|
|
template<typename T>
|
|
|
- using AlignedType = AlignedData<sizeof(T), alignmentof(T)>;
|
|
|
+ using AlignedType = AlignedData<sizeof(T), alignof(T)>;
|
|
|
}
|
|
|
|
|
|
#endif
|