summaryrefslogtreecommitdiff
path: root/src/mongo/config.h.in
diff options
context:
space:
mode:
authorBilly Donahue <billy.donahue@mongodb.com>2019-10-02 14:19:43 +0000
committerevergreen <evergreen@mongodb.com>2019-10-02 14:19:43 +0000
commit3175a30264d26b31309e9a4abfb69d9f14136702 (patch)
tree8864b8f41072071eb4603323cdbf1c76ba54a618 /src/mongo/config.h.in
parentdadd0a797c334219b5980e7ac2dc9e38288bdc38 (diff)
downloadmongo-3175a30264d26b31309e9a4abfb69d9f14136702.tar.gz
SERVER-43175 platform/endian.h refresh
This is a very low-level bare metal header, and should ideally #include only std headers. - Remove Decimal128 dependency from endian.h. Decimal128 doesn't need endian conversions, and makes endian.h transitively include several higher-level mongo specifics. Current conversions are underspecified and mathematically incorrect or at least ambiguous. They swap the order within each of the low64 and high64 fields, but don't swap them with each other. This is behavior needed only by one spot in db/pipeline/value.cpp to deserialize NumberDecimal, so we can just inline the behavior there and remove it from endian.h. - Remove MONGO_CONFIG_BYTE_ORDER from config.h. The running compiler holds the ultimate truth on what the target endianness is (available via _BYTE_ORDER_). We should not read it from a config header. The names exported into C++ code for the endian possibilities can be changed to line up with those in C++20's std::endian {big,little,native} enum. This eliminates the Scons<=>C++ bridge protocol of "1234" and "4321" magic numbers. Scons will talk to the compiler, not directly to the code. - Use enum expressions (including if constexpr) rather than #if for branching on endianness. This makes bit-rot of unexecuted paths less likely, and is just cleaner C++. - Remove bswap_slow variants. All supported compilers have builtin bswap operations. Can reduce to a simple MSVC vs GCC branching. All compilers have a builtin, so remove the bswap_slow" implementation. - Don't need all the push_macro / pop_macro stuff, or really any macros at all. Just rely on inline C++ functions. These optimize to the same thing. - Don't need ByteOrderConverter or IntegralTypeMap traits either. Simpler metaprogramming based only on sizeof will work fine. All in all we can remove about 400 lines of old code here and shave some low-level edges off of the dependency graph. - benchmark
Diffstat (limited to 'src/mongo/config.h.in')
-rw-r--r--src/mongo/config.h.in3
1 files changed, 0 insertions, 3 deletions
diff --git a/src/mongo/config.h.in b/src/mongo/config.h.in
index 74307db5de5..c7a9e1f5fd9 100644
--- a/src/mongo/config.h.in
+++ b/src/mongo/config.h.in
@@ -38,9 +38,6 @@
// Define altivec vec_vbpermq output index
@mongo_config_altivec_vec_vbpermq_output_index@
-// Define to target byte order (1234 vs 4321)
-@mongo_config_byte_order@
-
// Define if building a debug build
@mongo_config_debug_build@