summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/key_string.h
diff options
context:
space:
mode:
authorMatt Cotter <matt.cotter@mongodb.com>2016-09-08 17:24:07 -0400
committerMatt Cotter <matt.cotter@mongodb.com>2016-09-09 13:22:25 -0400
commit2bd286acef2fdb035f1d45253f6e6e4c24a2dc04 (patch)
tree13943305b07a3e368ca48d5b1520cfee02ce0b3f /src/mongo/db/storage/key_string.h
parentae280145c3c3dc770884a68885e80a282e8d50fd (diff)
downloadmongo-2bd286acef2fdb035f1d45253f6e6e4c24a2dc04.tar.gz
SERVER-22973 use mongo macros for static assert
Diffstat (limited to 'src/mongo/db/storage/key_string.h')
-rw-r--r--src/mongo/db/storage/key_string.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/db/storage/key_string.h b/src/mongo/db/storage/key_string.h
index 5b3d256f0d4..5884c707082 100644
--- a/src/mongo/db/storage/key_string.h
+++ b/src/mongo/db/storage/key_string.h
@@ -32,6 +32,7 @@
#include <limits>
+#include "mongo/base/static_assert.h"
#include "mongo/bson/bsonmisc.h"
#include "mongo/bson/bsonobj.h"
#include "mongo/bson/bsonobjbuilder.h"
@@ -67,8 +68,9 @@ public:
static const uint32_t kBytesForTypeAndEmptyKey = 2;
static const uint32_t kMaxDecimalsPerKey =
kMaxKeyBytes / (sizeof(Decimal128::Value) + kBytesForTypeAndEmptyKey);
- static_assert(kMaxTypeBitsPerDecimal * kMaxDecimalsPerKey < kMaxBytesNeeded * 8UL,
- "encoding needs change to contain all type bits for worst case key");
+ MONGO_STATIC_ASSERT_MSG(
+ kMaxTypeBitsPerDecimal* kMaxDecimalsPerKey < kMaxBytesNeeded * 8UL,
+ "encoding needs change to contain all type bits for worst case key");
static const uint8_t kStoredDecimalExponentBits = 6;
static const uint32_t kStoredDecimalExponentMask = (1U << kStoredDecimalExponentBits) - 1;