Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions base/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,16 @@

#define BN_IGNORE_DEPRECATION_WARNINGS_BEGIN BN_IGNORE_WARNINGS_BEGIN("-Wdeprecated-declarations", 4996)
#define BN_IGNORE_DEPRECATION_WARNINGS_END BN_IGNORE_WARNINGS_END

// BN_EMPTY_BASES
//
// Applied to a class definition to enable the empty base optimization across multiple
// empty base classes. Clang and GCC do this unconditionally, but MSVC only collapses a
// single empty base unless the class is annotated with __declspec(empty_bases). Without
// it, a class with several empty bases is padded larger than the sum of its data members.

#if defined(_MSC_VER)
#define BN_EMPTY_BASES __declspec(empty_bases)
#else
#define BN_EMPTY_BASES
#endif
Loading