Skip to content

Commit

Permalink
Avoid C++20 designated initializers.
Browse files Browse the repository at this point in the history
Apply the patch from microsoft/vcpkg#14341 to avoid designated intiializers, which makes oatpp-mongo compatible with more compilers.
  • Loading branch information
BillyONeal committed Nov 4, 2020
1 parent ebfad69 commit 83b6261
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/oatpp-mongo/bson/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ Utils::BO_TYPE Utils::FLOAT_BO = detectFloatBO();

Utils::BO_TYPE Utils::detectIntBO() {
BO_TYPE result = BO_TYPE::UNKNOWN;
BO_CHECK check {.i64 = 255};
BO_CHECK check;
check.i64 = 255;
if(check.bytes[0] == 255) {
result = BO_TYPE::LITTLE;
} else if(check.bytes[7] == 255) {
Expand All @@ -45,7 +46,8 @@ Utils::BO_TYPE Utils::detectIntBO() {

Utils::BO_TYPE Utils::detectFloatBO() {
BO_TYPE result = BO_TYPE::UNKNOWN;
BO_CHECK check {.f64 = 2.0};
BO_CHECK check;
check.f64 = 2.0;
if(check.bytes[0] > 0) {
result = BO_TYPE::NETWORK;
} else if(check.bytes[7] > 0) {
Expand Down

0 comments on commit 83b6261

Please sign in to comment.