diff --git a/easy_profiler_core/chunk_allocator.h b/easy_profiler_core/chunk_allocator.h index 466f30a..b780948 100644 --- a/easy_profiler_core/chunk_allocator.h +++ b/easy_profiler_core/chunk_allocator.h @@ -55,7 +55,7 @@ The Apache License, Version 2.0 (the "License"); #endif #ifndef EASY_ALIGNMENT_SIZE -# define EASY_ALIGNMENT_SIZE alignof(std::max_align_t) +# define EASY_ALIGNMENT_SIZE EASY_ALIGNOF(std::max_align_t) #endif EASY_CONSTEXPR auto EASY_ALIGN_SIZE = EASY_ALIGNMENT_SIZE; diff --git a/easy_profiler_core/include/easy/details/easy_compiler_support.h b/easy_profiler_core/include/easy/details/easy_compiler_support.h index 7531dbe..0ef1e8b 100644 --- a/easy_profiler_core/include/easy/details/easy_compiler_support.h +++ b/easy_profiler_core/include/easy/details/easy_compiler_support.h @@ -101,6 +101,9 @@ // No noexcept support before Visual Studio 2015 # define EASY_NOEXCEPT throw() + +// No alignof support before Visual Studio 2015 +# define EASY_ALIGNOF(x) __alignof(x) # endif # if EASY_STD > 11 && _MSC_VER >= 1900 @@ -238,6 +241,10 @@ static_assert(false, "EasyProfiler is not configured for using your compiler typ # define EASY_NOEXCEPT_AVAILABLE #endif +#ifndef EASY_ALIGNOF +# define EASY_ALIGNOF(x) alignof(x) +#endif + #ifndef PROFILER_API # define PROFILER_API #endif