diff options
author | Alexander Neben <alexander.neben@mongodb.com> | 2023-04-18 17:31:42 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-04-18 20:44:03 +0000 |
commit | 0905f3ed791f37bf232c0233be7bf208886744c8 (patch) | |
tree | 4b62bba3cdfc53f25d792d3dee567f9d5a961a9b /src | |
parent | 24c09afa20bb2dd94192182fabaffd09b3a80545 (diff) | |
download | mongo-0905f3ed791f37bf232c0233be7bf208886744c8.tar.gz |
SERVER-62997 Start building everything with c++20
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/base/status_with.h | 8 | ||||
-rw-r--r-- | src/mongo/db/geo/big_polygon.h | 3 | ||||
-rw-r--r-- | src/mongo/db/geo/s2.h | 45 | ||||
-rw-r--r-- | src/mongo/db/geo/shapes.h | 2 | ||||
-rw-r--r-- | src/mongo/db/index/expression_keys_private.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/query/index_bounds_builder.cpp | 2 | ||||
-rw-r--r-- | src/third_party/mozjs/include/mozilla/MathAlgorithms.h | 8 |
7 files changed, 8 insertions, 62 deletions
diff --git a/src/mongo/base/status_with.h b/src/mongo/base/status_with.h index 0781fd99480..111612a7f70 100644 --- a/src/mongo/base/status_with.h +++ b/src/mongo/base/status_with.h @@ -248,22 +248,22 @@ bool operator!=(const Status& status, const StatusWith<T>& sw) { // template <typename T> -bool operator==(const StatusWith<T>& sw, const ErrorCodes::Error code) { +bool operator==(const StatusWith<T>& sw, ErrorCodes::Error code) { return sw.getStatus() == code; } template <typename T> -bool operator==(const ErrorCodes::Error code, const StatusWith<T>& sw) { +bool operator==(ErrorCodes::Error code, const StatusWith<T>& sw) { return code == sw.getStatus(); } template <typename T> -bool operator!=(const StatusWith<T>& sw, const ErrorCodes::Error code) { +bool operator!=(const StatusWith<T>& sw, ErrorCodes::Error code) { return !(sw == code); } template <typename T> -bool operator!=(const ErrorCodes::Error code, const StatusWith<T>& sw) { +bool operator!=(ErrorCodes::Error code, const StatusWith<T>& sw) { return !(code == sw); } diff --git a/src/mongo/db/geo/big_polygon.h b/src/mongo/db/geo/big_polygon.h index 03b30ef8319..3e59160b90b 100644 --- a/src/mongo/db/geo/big_polygon.h +++ b/src/mongo/db/geo/big_polygon.h @@ -29,6 +29,7 @@ #pragma once +#include <s2.h> #include <s2cap.h> #include <s2cell.h> #include <s2loop.h> @@ -37,8 +38,6 @@ #include <s2region.h> #include <vector> -#include "mongo/db/geo/s2.h" - namespace mongo { // Simple GeoJSON polygon with a custom CRS identifier as having a strict winding order. diff --git a/src/mongo/db/geo/s2.h b/src/mongo/db/geo/s2.h deleted file mode 100644 index f86087538e3..00000000000 --- a/src/mongo/db/geo/s2.h +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Copyright (C) 2018-present MongoDB, Inc. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the Server Side Public License, version 1, - * as published by MongoDB, Inc. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * Server Side Public License for more details. - * - * You should have received a copy of the Server Side Public License - * along with this program. If not, see - * <http://www.mongodb.com/licensing/server-side-public-license>. - * - * As a special exception, the copyright holders give permission to link the - * code of portions of this program with the OpenSSL library under certain - * conditions as described in each individual source file and distribute - * linked combinations including the program with the OpenSSL library. You - * must comply with the Server Side Public License in all respects for - * all of the code used other than as permitted herein. If you modify file(s) - * with this exception, you may extend this exception to your version of the - * file(s), but you are not obligated to do so. If you do not wish to do so, - * delete this exception statement from your version. If you delete this - * exception statement from all source files in the program, then also delete - * it in the license file. - */ - -#pragma once - -/* - * This file's purpose is to confine the suppression of the Clang warning for - * mismatched-tags (struct vs class) in only the s2.h file - */ - -#ifdef __clang__ -#pragma GCC diagnostic ignored "-Wmismatched-tags" -#endif - -#include <s2.h> - -#ifdef __clang__ -#pragma GCC diagnostic pop -#endif diff --git a/src/mongo/db/geo/shapes.h b/src/mongo/db/geo/shapes.h index 96c645900ca..031ff0117c1 100644 --- a/src/mongo/db/geo/shapes.h +++ b/src/mongo/db/geo/shapes.h @@ -30,6 +30,7 @@ #pragma once #include <cmath> +#include <s2.h> #include <s2cap.h> #include <s2cell.h> #include <s2latlng.h> @@ -40,7 +41,6 @@ #include "mongo/base/clonable_ptr.h" #include "mongo/db/geo/big_polygon.h" -#include "mongo/db/geo/s2.h" #include "mongo/db/jsobj.h" #ifndef M_PI diff --git a/src/mongo/db/index/expression_keys_private.cpp b/src/mongo/db/index/expression_keys_private.cpp index 1d574121050..422526c5532 100644 --- a/src/mongo/db/index/expression_keys_private.cpp +++ b/src/mongo/db/index/expression_keys_private.cpp @@ -30,6 +30,7 @@ #include "mongo/db/index/expression_keys_private.h" +#include <s2.h> #include <s2cell.h> #include <s2regioncoverer.h> #include <utility> @@ -43,7 +44,6 @@ #include "mongo/db/geo/geoconstants.h" #include "mongo/db/geo/geometry_container.h" #include "mongo/db/geo/geoparser.h" -#include "mongo/db/geo/s2.h" #include "mongo/db/index/2d_common.h" #include "mongo/db/index/s2_common.h" #include "mongo/db/index_names.h" diff --git a/src/mongo/db/query/index_bounds_builder.cpp b/src/mongo/db/query/index_bounds_builder.cpp index 804bdef8466..8f854b2f550 100644 --- a/src/mongo/db/query/index_bounds_builder.cpp +++ b/src/mongo/db/query/index_bounds_builder.cpp @@ -32,13 +32,13 @@ #include <cmath> #include <limits> +#include <s2.h> #include <s2cell.h> #include <s2regioncoverer.h> #include "mongo/base/string_data.h" #include "mongo/bson/bsontypes.h" #include "mongo/db/geo/geoconstants.h" -#include "mongo/db/geo/s2.h" #include "mongo/db/index/expression_params.h" #include "mongo/db/index/s2_common.h" #include "mongo/db/matcher/expression_geo.h" diff --git a/src/third_party/mozjs/include/mozilla/MathAlgorithms.h b/src/third_party/mozjs/include/mozilla/MathAlgorithms.h index 8c64685ef1d..a35de339af6 100644 --- a/src/third_party/mozjs/include/mozilla/MathAlgorithms.h +++ b/src/third_party/mozjs/include/mozilla/MathAlgorithms.h @@ -199,14 +199,6 @@ inline uint_fast8_t CountTrailingZeroes64(uint64_t aValue) { #elif defined(__clang__) || defined(__GNUC__) -# if defined(__clang__) -# if !__has_builtin(__builtin_ctz) || !__has_builtin(__builtin_clz) -# error "A clang providing __builtin_c[lt]z is required to build" -# endif -# else -// gcc has had __builtin_clz and friends since 3.4: no need to check. -# endif - inline uint_fast8_t CountLeadingZeroes32(uint32_t aValue) { return static_cast<uint_fast8_t>(__builtin_clz(aValue)); } |