Skip to content

Commit 0f0a072

Browse files
committed
suppress MSVC warning 4324: 'structure was padded due to alignment specifier'
1 parent 341b915 commit 0f0a072

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

include/quill/core/LoggerBase.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ class BackendWorker;
3232
class BacktraceStorage;
3333
class LoggerManager;
3434

35+
#if defined(_WIN32) && defined(_MSC_VER) && !defined(__GNUC__)
36+
#pragma warning(push)
37+
#pragma warning(disable : 4324)
38+
#endif
39+
3540
/***/
3641
class alignas(QUILL_CACHE_LINE_SIZE) LoggerBase
3742
{
@@ -222,6 +227,12 @@ class alignas(QUILL_CACHE_LINE_SIZE) LoggerBase
222227
std::shared_ptr<PatternFormatter> _pattern_formatter; /* The backend thread will set this once, we never access it on the frontend */
223228
std::shared_ptr<BacktraceStorage> _backtrace_storage; /* The backend thread will construct this, we never access it on the frontend */
224229
};
230+
231+
static_assert((sizeof(LoggerBase) % QUILL_CACHE_LINE_SIZE) == 0);
232+
#if defined(_WIN32) && defined(_MSC_VER) && !defined(__GNUC__)
233+
#pragma warning(pop)
234+
#endif
235+
225236
} // namespace detail
226237

227238
QUILL_END_NAMESPACE

0 commit comments

Comments
 (0)