Skip to content

Commit 7d5add3

Browse files
authored
Force Firestore to conform to C99 and C++11. (#2001)
Note that c++0x is how Xcode spells c++11. Also fix an issue where we were accidentally using a C++14 feature.
1 parent fc2c234 commit 7d5add3

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

FirebaseFirestore.podspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ Google Cloud Firestore is a NoSQL document database built for automatic scaling,
6060
s.frameworks = 'MobileCoreServices', 'SystemConfiguration'
6161
s.library = 'c++'
6262
s.pod_target_xcconfig = {
63+
'CLANG_CXX_LANGUAGE_STANDARD' => 'c++0x',
6364
'GCC_C_LANGUAGE_STANDARD' => 'c99',
6465
'GCC_PREPROCESSOR_DEFINITIONS' =>
6566
"FIRFirestore_VERSION=#{s.version} " +

Firestore/Example/Firestore.xcodeproj/project.pbxproj

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@
543543
B79CA87A1A01FC5329031C9B /* Pods_Firestore_FuzzTests_iOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Firestore_FuzzTests_iOS.framework; sourceTree = BUILT_PRODUCTS_DIR; };
544544
B9C261C26C5D311E1E3C0CB9 /* query_test.cc */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.cpp.cpp; path = query_test.cc; sourceTree = "<group>"; };
545545
BB92EB03E3F92485023F64ED /* Pods_Firestore_Example_iOS_Firestore_SwiftTests_iOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Firestore_Example_iOS_Firestore_SwiftTests_iOS.framework; sourceTree = BUILT_PRODUCTS_DIR; };
546-
C8522DE226C467C54E6788D8 /* mutation_test.cc */ = {isa = PBXFileReference; includeInIndex = 1; path = mutation_test.cc; sourceTree = "<group>"; };
546+
C8522DE226C467C54E6788D8 /* mutation_test.cc */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.cpp.cpp; path = mutation_test.cc; sourceTree = "<group>"; };
547547
D3CC3DC5338DCAF43A211155 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
548548
D5B2593BCB52957D62F1C9D3 /* perf_spec_test.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = perf_spec_test.json; sourceTree = "<group>"; };
549549
DE03B2E91F2149D600A30B9C /* Firestore_IntegrationTests_iOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Firestore_IntegrationTests_iOS.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -2095,7 +2095,6 @@
20952095
BUNDLE_LOADER = "$(TEST_HOST)";
20962096
CLANG_ANALYZER_NONNULL = YES;
20972097
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
2098-
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
20992098
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
21002099
CLANG_WARN_COMMA = YES;
21012100
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
@@ -2134,7 +2133,6 @@
21342133
BUNDLE_LOADER = "$(TEST_HOST)";
21352134
CLANG_ANALYZER_NONNULL = YES;
21362135
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
2137-
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
21382136
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
21392137
CLANG_WARN_COMMA = YES;
21402138
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
@@ -2338,7 +2336,7 @@
23382336
isa = XCBuildConfiguration;
23392337
buildSettings = {
23402338
ALWAYS_SEARCH_USER_PATHS = NO;
2341-
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
2339+
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
23422340
CLANG_CXX_LIBRARY = "libc++";
23432341
CLANG_ENABLE_MODULES = YES;
23442342
CLANG_ENABLE_OBJC_ARC = YES;
@@ -2353,7 +2351,7 @@
23532351
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
23542352
COPY_PHASE_STRIP = NO;
23552353
ENABLE_TESTABILITY = YES;
2356-
GCC_C_LANGUAGE_STANDARD = gnu99;
2354+
GCC_C_LANGUAGE_STANDARD = c99;
23572355
GCC_DYNAMIC_NO_PIC = NO;
23582356
GCC_OPTIMIZATION_LEVEL = 0;
23592357
GCC_PREPROCESSOR_DEFINITIONS = (
@@ -2380,7 +2378,7 @@
23802378
isa = XCBuildConfiguration;
23812379
buildSettings = {
23822380
ALWAYS_SEARCH_USER_PATHS = NO;
2383-
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
2381+
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
23842382
CLANG_CXX_LIBRARY = "libc++";
23852383
CLANG_ENABLE_MODULES = YES;
23862384
CLANG_ENABLE_OBJC_ARC = YES;
@@ -2395,7 +2393,7 @@
23952393
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
23962394
COPY_PHASE_STRIP = YES;
23972395
ENABLE_NS_ASSERTIONS = NO;
2398-
GCC_C_LANGUAGE_STANDARD = gnu99;
2396+
GCC_C_LANGUAGE_STANDARD = c99;
23992397
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
24002398
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
24012399
GCC_WARN_UNDECLARED_SELECTOR = YES;

Firestore/Source/Core/FSTFirestoreClient.mm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,10 @@ - (instancetype)initWithDatabaseInfo:(const DatabaseInfo &)databaseInfo
128128
_workerDispatchQueue = workerDispatchQueue;
129129

130130
auto userPromise = std::make_shared<std::promise<User>>();
131+
bool initialized = false;
131132

132133
__weak __typeof__(self) weakSelf = self;
133-
auto credentialChangeListener = [initialized = false, userPromise, weakSelf,
134+
auto credentialChangeListener = [initialized, userPromise, weakSelf,
134135
workerDispatchQueue](User user) mutable {
135136
__typeof__(self) strongSelf = weakSelf;
136137
if (!strongSelf) return;

0 commit comments

Comments
 (0)