Skip to content
Draft
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

cmake_minimum_required(VERSION 3.22)

set (CMAKE_CXX_STANDARD 14)
set (CMAKE_CXX_STANDARD 17)
set (CMAKE_CXX_STANDARD_REQUIRED YES) # Don't fall back to an earlier version.

# Turn on virtual folders for visual studio
Expand Down
4 changes: 2 additions & 2 deletions analytics/integration_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ set(FIREBASE_INTEGRATION_TEST_SRCS
# The include directory for the testapp.
include_directories(src)

# Firebase C++ SDK requires C++14.
set (CMAKE_CXX_STANDARD 14)
# Firebase C++ SDK requires C++17.
set (CMAKE_CXX_STANDARD 17)
set (CMAKE_CXX_STANDARD_REQUIRED YES) # Don't fall back to an earlier version.

# Download and unpack googletest (and googlemock) at configure time
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
Expand Down Expand Up @@ -379,7 +379,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
Expand Down Expand Up @@ -482,7 +482,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
Expand Down Expand Up @@ -536,7 +536,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
Expand Down Expand Up @@ -587,8 +587,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/firebase/firebase-ios-sdk.git";
requirement = {
kind = exactVersion;
version = 12.19.0;
kind = revision;
revision = 8d7687f915e31b84ec3dfc816034c3fc571be5e6;
};
};
/* End XCRemoteSwiftPackageReference section */
Expand Down
4 changes: 2 additions & 2 deletions app/integration_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ set(FIREBASE_INTEGRATION_TEST_SRCS
# The include directory for the testapp.
include_directories(src)

# Firebase C++ SDK requires C++14.
set (CMAKE_CXX_STANDARD 14)
# Firebase C++ SDK requires C++17.
set (CMAKE_CXX_STANDARD 17)
set (CMAKE_CXX_STANDARD_REQUIRED YES) # Don't fall back to an earlier version.

# Download and unpack googletest (and googlemock) at configure time
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
Expand Down Expand Up @@ -263,7 +263,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
Expand Down Expand Up @@ -366,8 +366,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/firebase/firebase-ios-sdk.git";
requirement = {
kind = exactVersion;
version = 12.19.0;
kind = revision;
revision = 8d7687f915e31b84ec3dfc816034c3fc571be5e6;
};
};
/* End XCRemoteSwiftPackageReference section */
Expand Down
4 changes: 2 additions & 2 deletions app/rest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
# CMake file for the firebase_rest_lib library

cmake_minimum_required(VERSION 3.22)
# Firebase C++ SDK requires C++14.
set (CMAKE_CXX_STANDARD 14)
# Firebase C++ SDK requires C++17.
set (CMAKE_CXX_STANDARD 17)
set (CMAKE_CXX_STANDARD_REQUIRED YES) # Don't fall back to an earlier version.

project(firebase_rest_lib NONE)
Expand Down
4 changes: 2 additions & 2 deletions app_check/integration_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ set(FIREBASE_INTEGRATION_TEST_SRCS
# The include directory for the testapp.
include_directories(src)

# Firebase C++ SDK requires C++14.
set (CMAKE_CXX_STANDARD 14)
# Firebase C++ SDK requires C++17.
set (CMAKE_CXX_STANDARD 17)
set (CMAKE_CXX_STANDARD_REQUIRED YES) # Don't fall back to an earlier version.

# Download and unpack googletest (and googlemock) at configure time
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
Expand Down Expand Up @@ -405,7 +405,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
Expand Down Expand Up @@ -510,7 +510,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
Expand Down Expand Up @@ -564,7 +564,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
Expand Down Expand Up @@ -615,8 +615,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/firebase/firebase-ios-sdk.git";
requirement = {
kind = exactVersion;
version = 12.19.0;
kind = revision;
revision = 8d7687f915e31b84ec3dfc816034c3fc571be5e6;
};
};
/* End XCRemoteSwiftPackageReference section */
Expand Down
4 changes: 2 additions & 2 deletions auth/integration_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ set(FIREBASE_INTEGRATION_TEST_SRCS
# The include directory for the testapp.
include_directories(src)

# Firebase C++ SDK requires C++14.
set (CMAKE_CXX_STANDARD 14)
# Firebase C++ SDK requires C++17.
set (CMAKE_CXX_STANDARD 17)
set (CMAKE_CXX_STANDARD_REQUIRED YES) # Don't fall back to an earlier version.

# Download and unpack googletest (and googlemock) at configure time
Expand Down
12 changes: 6 additions & 6 deletions auth/integration_test/integration_test.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
Expand Down Expand Up @@ -406,7 +406,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
Expand Down Expand Up @@ -511,7 +511,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
Expand Down Expand Up @@ -565,7 +565,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
Expand Down Expand Up @@ -616,8 +616,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/firebase/firebase-ios-sdk.git";
requirement = {
kind = exactVersion;
version = 12.19.0;
kind = revision;
revision = 8d7687f915e31b84ec3dfc816034c3fc571be5e6;
};
};
/* End XCRemoteSwiftPackageReference section */
Expand Down
2 changes: 1 addition & 1 deletion cmake/external/firestore.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ endif()

# If the format of the line below changes, then be sure to update
# https://github.com/firebase/firebase-cpp-sdk/blob/fd054fa016/.github/workflows/update-dependencies.yml#L81
set(version 12.19.0)
set(version 8d7687f915e31b84ec3dfc816034c3fc571be5e6)

function(GetReleasedDep)
message("Getting released firebase-ios-sdk @ ${version}")
Expand Down
115 changes: 115 additions & 0 deletions cmake/external/firestore.patch.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,118 @@ index 920bf2928..c5c9cc7ee 100644

ExternalProject_Get_property(snappy SOURCE_DIR)
set(snappy_source_dir "${SOURCE_DIR}")
diff --git a/Firestore/core/src/util/ordered_code.h b/Firestore/core/src/util/ordered_code.h
--- a/Firestore/core/src/util/ordered_code.h
+++ b/Firestore/core/src/util/ordered_code.h
@@ -39,7 +39,8 @@
#ifndef FIRESTORE_CORE_SRC_UTIL_ORDERED_CODE_H_
#define FIRESTORE_CORE_SRC_UTIL_ORDERED_CODE_H_

+#include <cstdint>
#include <string>

#include "absl/strings/string_view.h"

diff --git a/Firestore/core/src/util/quadruple.cc b/Firestore/core/src/util/quadruple.cc
--- a/Firestore/core/src/util/quadruple.cc
+++ b/Firestore/core/src/util/quadruple.cc
@@ -20,6 +20,7 @@
#include <limits>
#include <vector>

+#include "Firestore/core/src/util/bits.h"
#include "Firestore/core/src/util/quadruple_builder.h"

namespace firebase {
@@ -89,7 +90,7 @@ Quadruple::Quadruple(int64_t x) {
mantissa_lo_ = 0;
} else {
uint64_t ux = static_cast<uint64_t>(x);
- int leading_zeros = __builtin_clzll(ux);
+ int leading_zeros = 63 - Bits::Log2FloorNonZero64(ux);
// Left-justify with the leading 1 dropped.
mantissa_hi_ = ux << (leading_zeros + 1);
mantissa_lo_ = 0;
@@ -225,7 +226,8 @@ Quadruple::operator double() const {
}
default:
int32_t unbiased_exp = static_cast<int32_t>(exponent_ - kExponentBias);
- return scalb((1LL << 52) | (mantissa_hi_ >> 12), -52 + unbiased_exp) *
+ return ldexp(static_cast<double>((1ULL << 52) | (mantissa_hi_ >> 12)),
+ -52 + unbiased_exp) *
(negative_ ? -1 : 1);
}
}
diff --git a/Firestore/core/src/util/quadruple_builder.h b/Firestore/core/src/util/quadruple_builder.h
--- a/Firestore/core/src/util/quadruple_builder.h
+++ b/Firestore/core/src/util/quadruple_builder.h
@@ -16,7 +16,6 @@
#ifndef FIRESTORE_CORE_SRC_UTIL_QUADRUPLE_BUILDER_H_
#define FIRESTORE_CORE_SRC_UTIL_QUADRUPLE_BUILDER_H_

-#include <bit>
#include <cstddef>
#include <cstdint>

diff --git a/Firestore/core/src/util/quadruple_builder.cc b/Firestore/core/src/util/quadruple_builder.cc
--- a/Firestore/core/src/util/quadruple_builder.cc
+++ b/Firestore/core/src/util/quadruple_builder.cc
@@ -19,6 +19,8 @@
#include <cmath>
#include <limits>

+#include "Firestore/core/src/util/bits.h"
+
namespace firebase {
namespace firestore {
namespace util {
@@ -785,7 +787,7 @@ void QuadrupleBuilder::multBuffBy10(std::array<uint64_t, N>& buffer) {
// added to the result's exponent, or 0 otherwise
template <std::size_t N>
int32_t QuadrupleBuilder::normalizeMant(std::array<uint64_t, N>& mantissa) {
- int32_t expCorr = 31 - __builtin_clzll(mantissa[0]);
+ int32_t expCorr = 31 - (63 - Bits::Log2FloorNonZero64(mantissa[0]));
if (expCorr != 0) {
divBuffByPower2(mantissa, expCorr);
}
diff --git a/Firestore/core/test/unit/model/mutation_test.cc b/Firestore/core/test/unit/model/mutation_test.cc
--- a/Firestore/core/test/unit/model/mutation_test.cc
+++ b/Firestore/core/test/unit/model/mutation_test.cc
@@ -403,29 +403,29 @@ TEST(MutationTest, AppliesIncrementTransformsConsecutively) {

TEST(MutationTest, AppliesIncrementWithoutOverflow) {
auto base_data =
- Map("a", LONG_MAX - 1, "b", LONG_MAX - 1, "c", LONG_MAX, "d", LONG_MAX);
+ Map("a", INT64_MAX - 1, "b", INT64_MAX - 1, "c", INT64_MAX, "d", INT64_MAX);
TransformPairs transforms = {
{"a", Increment(1)},
- {"b", Increment(LONG_MAX)},
+ {"b", Increment(INT64_MAX)},
{"c", Increment(1)},
- {"d", Increment(LONG_MAX)},
+ {"d", Increment(INT64_MAX)},
};
auto expected =
- Map("a", LONG_MAX, "b", LONG_MAX, "c", LONG_MAX, "d", LONG_MAX);
+ Map("a", INT64_MAX, "b", INT64_MAX, "c", INT64_MAX, "d", INT64_MAX);
TransformBaseDoc(std::move(base_data), transforms, std::move(expected));
}

TEST(MutationTest, AppliesIncrementWithoutUnderflow) {
auto base_data =
- Map("a", LONG_MIN + 1, "b", LONG_MIN + 1, "c", LONG_MIN, "d", LONG_MIN);
+ Map("a", INT64_MIN + 1, "b", INT64_MIN + 1, "c", INT64_MIN, "d", INT64_MIN);
TransformPairs transforms = {
{"a", Increment(-1)},
- {"b", Increment(LONG_MIN)},
+ {"b", Increment(INT64_MIN)},
{"c", Increment(-1)},
- {"d", Increment(LONG_MIN)},
+ {"d", Increment(INT64_MIN)},
};
auto expected =
- Map("a", LONG_MIN, "b", LONG_MIN, "c", LONG_MIN, "d", LONG_MIN);
+ Map("a", INT64_MIN, "b", INT64_MIN, "c", INT64_MIN, "d", INT64_MIN);
TransformBaseDoc(std::move(base_data), transforms, std::move(expected));
}

4 changes: 2 additions & 2 deletions database/integration_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ set(FIREBASE_INTEGRATION_TEST_SRCS
# The include directory for the testapp.
include_directories(src)

# Firebase C++ SDK requires C++14.
set (CMAKE_CXX_STANDARD 14)
# Firebase C++ SDK requires C++17.
set (CMAKE_CXX_STANDARD 17)
set (CMAKE_CXX_STANDARD_REQUIRED YES) # Don't fall back to an earlier version.

# Download and unpack googletest (and googlemock) at configure time
Expand Down
Loading
Loading