aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Firestore/Source')
-rw-r--r--Firestore/Source/API/FIRDocumentChange.mm (renamed from Firestore/Source/API/FIRDocumentChange.m)0
-rw-r--r--Firestore/Source/API/FIRDocumentReference.mm (renamed from Firestore/Source/API/FIRDocumentReference.m)0
-rw-r--r--Firestore/Source/API/FIRDocumentSnapshot.mm (renamed from Firestore/Source/API/FIRDocumentSnapshot.m)0
-rw-r--r--Firestore/Source/API/FIRFieldPath.mm (renamed from Firestore/Source/API/FIRFieldPath.m)0
-rw-r--r--Firestore/Source/API/FIRFieldValue.mm (renamed from Firestore/Source/API/FIRFieldValue.m)0
-rw-r--r--Firestore/Source/API/FIRFirestore.mm (renamed from Firestore/Source/API/FIRFirestore.m)2
-rw-r--r--Firestore/Source/API/FIRFirestoreSettings.mm (renamed from Firestore/Source/API/FIRFirestoreSettings.m)0
-rw-r--r--Firestore/Source/API/FIRFirestoreVersion.mm (renamed from Firestore/Source/API/FIRFirestoreVersion.m)2
-rw-r--r--Firestore/Source/API/FIRListenerRegistration.mm (renamed from Firestore/Source/API/FIRListenerRegistration.m)0
-rw-r--r--Firestore/Source/API/FIRQuery.mm (renamed from Firestore/Source/API/FIRQuery.m)0
-rw-r--r--Firestore/Source/API/FIRQuerySnapshot.mm (renamed from Firestore/Source/API/FIRQuerySnapshot.m)0
-rw-r--r--Firestore/Source/API/FIRSetOptions.mm (renamed from Firestore/Source/API/FIRSetOptions.m)0
-rw-r--r--Firestore/Source/API/FIRSnapshotMetadata.mm (renamed from Firestore/Source/API/FIRSnapshotMetadata.m)0
-rw-r--r--Firestore/Source/API/FIRSnapshotOptions.mm (renamed from Firestore/Source/API/FIRSnapshotOptions.m)0
-rw-r--r--Firestore/Source/API/FIRTransaction.mm (renamed from Firestore/Source/API/FIRTransaction.m)0
-rw-r--r--Firestore/Source/API/FIRWriteBatch.mm (renamed from Firestore/Source/API/FIRWriteBatch.m)0
-rw-r--r--Firestore/Source/API/FSTUserDataConverter.mm (renamed from Firestore/Source/API/FSTUserDataConverter.m)0
-rw-r--r--Firestore/Source/Auth/FSTCredentialsProvider.mm (renamed from Firestore/Source/Auth/FSTCredentialsProvider.m)0
-rw-r--r--Firestore/Source/Auth/FSTEmptyCredentialsProvider.mm (renamed from Firestore/Source/Auth/FSTEmptyCredentialsProvider.m)0
-rw-r--r--Firestore/Source/Auth/FSTUser.mm (renamed from Firestore/Source/Auth/FSTUser.m)0
-rw-r--r--Firestore/Source/Core/FSTDatabaseInfo.mm (renamed from Firestore/Source/Core/FSTDatabaseInfo.m)0
-rw-r--r--Firestore/Source/Core/FSTEventManager.mm (renamed from Firestore/Source/Core/FSTEventManager.m)0
-rw-r--r--Firestore/Source/Core/FSTFirestoreClient.mm (renamed from Firestore/Source/Core/FSTFirestoreClient.m)0
-rw-r--r--Firestore/Source/Core/FSTListenSequence.mm (renamed from Firestore/Source/Core/FSTListenSequence.m)0
-rw-r--r--Firestore/Source/Core/FSTQuery.mm (renamed from Firestore/Source/Core/FSTQuery.m)22
-rw-r--r--Firestore/Source/Core/FSTSnapshotVersion.mm (renamed from Firestore/Source/Core/FSTSnapshotVersion.m)0
-rw-r--r--Firestore/Source/Core/FSTTransaction.mm (renamed from Firestore/Source/Core/FSTTransaction.m)32
-rw-r--r--Firestore/Source/Core/FSTView.mm (renamed from Firestore/Source/Core/FSTView.m)0
-rw-r--r--Firestore/Source/Core/FSTViewSnapshot.mm (renamed from Firestore/Source/Core/FSTViewSnapshot.m)0
-rw-r--r--Firestore/Source/Local/FSTEagerGarbageCollector.mm (renamed from Firestore/Source/Local/FSTEagerGarbageCollector.m)0
-rw-r--r--Firestore/Source/Local/FSTLevelDB.h14
-rw-r--r--Firestore/Source/Local/FSTLevelDBKey.h4
-rw-r--r--Firestore/Source/Local/FSTLevelDBMigrations.h8
-rw-r--r--Firestore/Source/Local/FSTLevelDBMutationQueue.h11
-rw-r--r--Firestore/Source/Local/FSTLevelDBQueryCache.h15
-rw-r--r--Firestore/Source/Local/FSTLevelDBRemoteDocumentCache.h11
-rw-r--r--Firestore/Source/Local/FSTLocalDocumentsView.mm (renamed from Firestore/Source/Local/FSTLocalDocumentsView.m)0
-rw-r--r--Firestore/Source/Local/FSTLocalSerializer.mm (renamed from Firestore/Source/Local/FSTLocalSerializer.m)2
-rw-r--r--Firestore/Source/Local/FSTLocalViewChanges.mm (renamed from Firestore/Source/Local/FSTLocalViewChanges.m)0
-rw-r--r--Firestore/Source/Local/FSTLocalWriteResult.mm (renamed from Firestore/Source/Local/FSTLocalWriteResult.m)0
-rw-r--r--Firestore/Source/Local/FSTMemoryPersistence.mm (renamed from Firestore/Source/Local/FSTMemoryPersistence.m)0
-rw-r--r--Firestore/Source/Local/FSTMemoryQueryCache.mm (renamed from Firestore/Source/Local/FSTMemoryQueryCache.m)0
-rw-r--r--Firestore/Source/Local/FSTMemoryRemoteDocumentCache.mm (renamed from Firestore/Source/Local/FSTMemoryRemoteDocumentCache.m)0
-rw-r--r--Firestore/Source/Local/FSTNoOpGarbageCollector.mm (renamed from Firestore/Source/Local/FSTNoOpGarbageCollector.m)0
-rw-r--r--Firestore/Source/Local/FSTQueryData.mm (renamed from Firestore/Source/Local/FSTQueryData.m)0
-rw-r--r--Firestore/Source/Local/FSTReferenceSet.mm (renamed from Firestore/Source/Local/FSTReferenceSet.m)0
-rw-r--r--Firestore/Source/Local/FSTRemoteDocumentChangeBuffer.mm (renamed from Firestore/Source/Local/FSTRemoteDocumentChangeBuffer.m)0
-rw-r--r--Firestore/Source/Local/FSTWriteGroup.h13
-rw-r--r--Firestore/Source/Local/FSTWriteGroupTracker.mm (renamed from Firestore/Source/Local/FSTWriteGroupTracker.m)0
-rw-r--r--Firestore/Source/Local/StringView.h4
-rw-r--r--Firestore/Source/Model/FSTDatabaseID.mm (renamed from Firestore/Source/Model/FSTDatabaseID.m)0
-rw-r--r--Firestore/Source/Model/FSTDocument.mm (renamed from Firestore/Source/Model/FSTDocument.m)0
-rw-r--r--Firestore/Source/Model/FSTDocumentDictionary.mm (renamed from Firestore/Source/Model/FSTDocumentDictionary.m)0
-rw-r--r--Firestore/Source/Model/FSTDocumentKey.mm (renamed from Firestore/Source/Model/FSTDocumentKey.m)0
-rw-r--r--Firestore/Source/Model/FSTDocumentKeySet.mm (renamed from Firestore/Source/Model/FSTDocumentKeySet.m)0
-rw-r--r--Firestore/Source/Model/FSTDocumentSet.mm (renamed from Firestore/Source/Model/FSTDocumentSet.m)0
-rw-r--r--Firestore/Source/Model/FSTDocumentVersionDictionary.mm (renamed from Firestore/Source/Model/FSTDocumentVersionDictionary.m)0
-rw-r--r--Firestore/Source/Model/FSTMutation.mm (renamed from Firestore/Source/Model/FSTMutation.m)0
-rw-r--r--Firestore/Source/Model/FSTMutationBatch.mm (renamed from Firestore/Source/Model/FSTMutationBatch.m)0
-rw-r--r--Firestore/Source/Model/FSTPath.mm (renamed from Firestore/Source/Model/FSTPath.m)0
-rw-r--r--Firestore/Source/Remote/FSTBufferedWriter.mm (renamed from Firestore/Source/Remote/FSTBufferedWriter.m)0
-rw-r--r--Firestore/Source/Remote/FSTDatastore.mm (renamed from Firestore/Source/Remote/FSTDatastore.m)0
-rw-r--r--Firestore/Source/Remote/FSTExistenceFilter.mm (renamed from Firestore/Source/Remote/FSTExistenceFilter.m)0
-rw-r--r--Firestore/Source/Remote/FSTRemoteEvent.mm (renamed from Firestore/Source/Remote/FSTRemoteEvent.m)12
-rw-r--r--Firestore/Source/Remote/FSTRemoteStore.mm (renamed from Firestore/Source/Remote/FSTRemoteStore.m)2
-rw-r--r--Firestore/Source/Remote/FSTSerializerBeta.mm (renamed from Firestore/Source/Remote/FSTSerializerBeta.m)30
-rw-r--r--Firestore/Source/Remote/FSTStream.mm (renamed from Firestore/Source/Remote/FSTStream.m)0
-rw-r--r--Firestore/Source/Remote/FSTWatchChange.mm (renamed from Firestore/Source/Remote/FSTWatchChange.m)0
-rw-r--r--Firestore/Source/Util/FSTAsyncQueryListener.mm (renamed from Firestore/Source/Util/FSTAsyncQueryListener.m)0
-rw-r--r--Firestore/Source/Util/FSTDispatchQueue.mm (renamed from Firestore/Source/Util/FSTDispatchQueue.m)0
-rw-r--r--Firestore/Source/Util/FSTLogger.h8
-rw-r--r--Firestore/Source/Util/FSTLogger.mm (renamed from Firestore/Source/Util/FSTLogger.m)0
-rw-r--r--Firestore/Source/Util/FSTUsageValidation.h8
-rw-r--r--Firestore/Source/Util/FSTUsageValidation.mm (renamed from Firestore/Source/Util/FSTUsageValidation.m)0
74 files changed, 79 insertions, 121 deletions
diff --git a/Firestore/Source/API/FIRDocumentChange.m b/Firestore/Source/API/FIRDocumentChange.mm
index d1d9999..d1d9999 100644
--- a/Firestore/Source/API/FIRDocumentChange.m
+++ b/Firestore/Source/API/FIRDocumentChange.mm
diff --git a/Firestore/Source/API/FIRDocumentReference.m b/Firestore/Source/API/FIRDocumentReference.mm
index 05253f7..05253f7 100644
--- a/Firestore/Source/API/FIRDocumentReference.m
+++ b/Firestore/Source/API/FIRDocumentReference.mm
diff --git a/Firestore/Source/API/FIRDocumentSnapshot.m b/Firestore/Source/API/FIRDocumentSnapshot.mm
index 10709e8..10709e8 100644
--- a/Firestore/Source/API/FIRDocumentSnapshot.m
+++ b/Firestore/Source/API/FIRDocumentSnapshot.mm
diff --git a/Firestore/Source/API/FIRFieldPath.m b/Firestore/Source/API/FIRFieldPath.mm
index f4e532f..f4e532f 100644
--- a/Firestore/Source/API/FIRFieldPath.m
+++ b/Firestore/Source/API/FIRFieldPath.mm
diff --git a/Firestore/Source/API/FIRFieldValue.m b/Firestore/Source/API/FIRFieldValue.mm
index 7ae4fb0..7ae4fb0 100644
--- a/Firestore/Source/API/FIRFieldValue.m
+++ b/Firestore/Source/API/FIRFieldValue.mm
diff --git a/Firestore/Source/API/FIRFirestore.m b/Firestore/Source/API/FIRFirestore.mm
index 9df3711..10367bd 100644
--- a/Firestore/Source/API/FIRFirestore.m
+++ b/Firestore/Source/API/FIRFirestore.mm
@@ -41,7 +41,7 @@
NS_ASSUME_NONNULL_BEGIN
-NSString *const FIRFirestoreErrorDomain = @"FIRFirestoreErrorDomain";
+extern "C" NSString *const FIRFirestoreErrorDomain = @"FIRFirestoreErrorDomain";
@interface FIRFirestore ()
diff --git a/Firestore/Source/API/FIRFirestoreSettings.m b/Firestore/Source/API/FIRFirestoreSettings.mm
index 9677ff6..9677ff6 100644
--- a/Firestore/Source/API/FIRFirestoreSettings.m
+++ b/Firestore/Source/API/FIRFirestoreSettings.mm
diff --git a/Firestore/Source/API/FIRFirestoreVersion.m b/Firestore/Source/API/FIRFirestoreVersion.mm
index 4f8bb28..b1fe480 100644
--- a/Firestore/Source/API/FIRFirestoreVersion.m
+++ b/Firestore/Source/API/FIRFirestoreVersion.mm
@@ -25,5 +25,5 @@
#define STR(x) STR_EXPAND(x)
#define STR_EXPAND(x) #x
-const unsigned char *const FirebaseFirestoreVersionString =
+extern "C" const unsigned char *const FirebaseFirestoreVersionString =
(const unsigned char *const)STR(FIRFirestore_VERSION);
diff --git a/Firestore/Source/API/FIRListenerRegistration.m b/Firestore/Source/API/FIRListenerRegistration.mm
index 9f4ddd5..9f4ddd5 100644
--- a/Firestore/Source/API/FIRListenerRegistration.m
+++ b/Firestore/Source/API/FIRListenerRegistration.mm
diff --git a/Firestore/Source/API/FIRQuery.m b/Firestore/Source/API/FIRQuery.mm
index 1bbf91e..1bbf91e 100644
--- a/Firestore/Source/API/FIRQuery.m
+++ b/Firestore/Source/API/FIRQuery.mm
diff --git a/Firestore/Source/API/FIRQuerySnapshot.m b/Firestore/Source/API/FIRQuerySnapshot.mm
index abee84c..abee84c 100644
--- a/Firestore/Source/API/FIRQuerySnapshot.m
+++ b/Firestore/Source/API/FIRQuerySnapshot.mm
diff --git a/Firestore/Source/API/FIRSetOptions.m b/Firestore/Source/API/FIRSetOptions.mm
index b41086c..b41086c 100644
--- a/Firestore/Source/API/FIRSetOptions.m
+++ b/Firestore/Source/API/FIRSetOptions.mm
diff --git a/Firestore/Source/API/FIRSnapshotMetadata.m b/Firestore/Source/API/FIRSnapshotMetadata.mm
index 27747ce..27747ce 100644
--- a/Firestore/Source/API/FIRSnapshotMetadata.m
+++ b/Firestore/Source/API/FIRSnapshotMetadata.mm
diff --git a/Firestore/Source/API/FIRSnapshotOptions.m b/Firestore/Source/API/FIRSnapshotOptions.mm
index 72ea3cc..72ea3cc 100644
--- a/Firestore/Source/API/FIRSnapshotOptions.m
+++ b/Firestore/Source/API/FIRSnapshotOptions.mm
diff --git a/Firestore/Source/API/FIRTransaction.m b/Firestore/Source/API/FIRTransaction.mm
index 5edff19..5edff19 100644
--- a/Firestore/Source/API/FIRTransaction.m
+++ b/Firestore/Source/API/FIRTransaction.mm
diff --git a/Firestore/Source/API/FIRWriteBatch.m b/Firestore/Source/API/FIRWriteBatch.mm
index b1cfa09..b1cfa09 100644
--- a/Firestore/Source/API/FIRWriteBatch.m
+++ b/Firestore/Source/API/FIRWriteBatch.mm
diff --git a/Firestore/Source/API/FSTUserDataConverter.m b/Firestore/Source/API/FSTUserDataConverter.mm
index 414aadb..414aadb 100644
--- a/Firestore/Source/API/FSTUserDataConverter.m
+++ b/Firestore/Source/API/FSTUserDataConverter.mm
diff --git a/Firestore/Source/Auth/FSTCredentialsProvider.m b/Firestore/Source/Auth/FSTCredentialsProvider.mm
index 653d7ff..653d7ff 100644
--- a/Firestore/Source/Auth/FSTCredentialsProvider.m
+++ b/Firestore/Source/Auth/FSTCredentialsProvider.mm
diff --git a/Firestore/Source/Auth/FSTEmptyCredentialsProvider.m b/Firestore/Source/Auth/FSTEmptyCredentialsProvider.mm
index e78452a..e78452a 100644
--- a/Firestore/Source/Auth/FSTEmptyCredentialsProvider.m
+++ b/Firestore/Source/Auth/FSTEmptyCredentialsProvider.mm
diff --git a/Firestore/Source/Auth/FSTUser.m b/Firestore/Source/Auth/FSTUser.mm
index 605b4e6..605b4e6 100644
--- a/Firestore/Source/Auth/FSTUser.m
+++ b/Firestore/Source/Auth/FSTUser.mm
diff --git a/Firestore/Source/Core/FSTDatabaseInfo.m b/Firestore/Source/Core/FSTDatabaseInfo.mm
index 2dbe61a..2dbe61a 100644
--- a/Firestore/Source/Core/FSTDatabaseInfo.m
+++ b/Firestore/Source/Core/FSTDatabaseInfo.mm
diff --git a/Firestore/Source/Core/FSTEventManager.m b/Firestore/Source/Core/FSTEventManager.mm
index bc204a0..bc204a0 100644
--- a/Firestore/Source/Core/FSTEventManager.m
+++ b/Firestore/Source/Core/FSTEventManager.mm
diff --git a/Firestore/Source/Core/FSTFirestoreClient.m b/Firestore/Source/Core/FSTFirestoreClient.mm
index fff644d..fff644d 100644
--- a/Firestore/Source/Core/FSTFirestoreClient.m
+++ b/Firestore/Source/Core/FSTFirestoreClient.mm
diff --git a/Firestore/Source/Core/FSTListenSequence.m b/Firestore/Source/Core/FSTListenSequence.mm
index 6f50d35..6f50d35 100644
--- a/Firestore/Source/Core/FSTListenSequence.m
+++ b/Firestore/Source/Core/FSTListenSequence.mm
diff --git a/Firestore/Source/Core/FSTQuery.m b/Firestore/Source/Core/FSTQuery.mm
index 13657f7..8c98687 100644
--- a/Firestore/Source/Core/FSTQuery.m
+++ b/Firestore/Source/Core/FSTQuery.mm
@@ -27,6 +27,13 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark - FSTRelationFilterOperator functions
+/**
+ * Returns the reverse order (i.e. Ascending => Descending) etc.
+ */
+static constexpr NSComparisonResult ReverseOrder(NSComparisonResult result) {
+ return static_cast<NSComparisonResult>(-static_cast<NSInteger>(result));
+}
+
NSString *FSTStringFromQueryRelationOperator(FSTRelationFilterOperator filterOperator) {
switch (filterOperator) {
case FSTRelationFilterOperatorLessThan:
@@ -287,16 +294,20 @@ NSString *FSTStringFromQueryRelationOperator(FSTRelationFilterOperator filterOpe
#pragma mark - Public methods
- (NSComparisonResult)compareDocument:(FSTDocument *)document1 toDocument:(FSTDocument *)document2 {
- int modifier = self.isAscending ? 1 : -1;
+ NSComparisonResult result;
if ([self.field isEqual:[FSTFieldPath keyFieldPath]]) {
- return (NSComparisonResult)(modifier * FSTDocumentKeyComparator(document1.key, document2.key));
+ result = FSTDocumentKeyComparator(document1.key, document2.key);
} else {
FSTFieldValue *value1 = [document1 fieldForPath:self.field];
FSTFieldValue *value2 = [document2 fieldForPath:self.field];
FSTAssert(value1 != nil && value2 != nil,
@"Trying to compare documents on fields that don't exist.");
- return modifier * [value1 compare:value2];
+ result = [value1 compare:value2];
+ }
+ if (!self.isAscending) {
+ result = ReverseOrder(result);
}
+ return result;
}
- (NSString *)canonicalID {
@@ -377,7 +388,8 @@ NSString *FSTStringFromQueryRelationOperator(FSTRelationFilterOperator filterOpe
if ([sortOrderComponent.field isEqual:[FSTFieldPath keyFieldPath]]) {
FSTAssert([fieldValue isKindOfClass:[FSTReferenceValue class]],
@"FSTBound has a non-key value where the key path is being used %@", fieldValue);
- comparison = [fieldValue.value compare:document.key];
+ FSTReferenceValue *refValue = (FSTReferenceValue *)fieldValue;
+ comparison = [refValue.value compare:document.key];
} else {
FSTFieldValue *docValue = [document fieldForPath:sortOrderComponent.field];
FSTAssert(docValue != nil, @"Field should exist since document matched the orderBy already.");
@@ -385,7 +397,7 @@ NSString *FSTStringFromQueryRelationOperator(FSTRelationFilterOperator filterOpe
}
if (!sortOrderComponent.isAscending) {
- comparison = comparison * -1;
+ comparison = ReverseOrder(comparison);
}
if (comparison != 0) {
diff --git a/Firestore/Source/Core/FSTSnapshotVersion.m b/Firestore/Source/Core/FSTSnapshotVersion.mm
index 980ae52..980ae52 100644
--- a/Firestore/Source/Core/FSTSnapshotVersion.m
+++ b/Firestore/Source/Core/FSTSnapshotVersion.mm
diff --git a/Firestore/Source/Core/FSTTransaction.m b/Firestore/Source/Core/FSTTransaction.mm
index c4c5f27..f97888a 100644
--- a/Firestore/Source/Core/FSTTransaction.m
+++ b/Firestore/Source/Core/FSTTransaction.mm
@@ -104,22 +104,22 @@ NS_ASSUME_NONNULL_BEGIN
FSTThrowInvalidUsage(@"FIRIllegalStateException",
@"All reads in a transaction must be done before any writes.");
}
- [self.datastore
- lookupDocuments:keys
- completion:^(NSArray<FSTDocument *> *_Nullable documents, NSError *_Nullable error) {
- if (error) {
- completion(nil, error);
- return;
- }
- for (FSTMaybeDocument *doc in documents) {
- NSError *recordError = nil;
- if (![self recordVersionForDocument:doc error:&recordError]) {
- completion(nil, recordError);
- return;
- }
- }
- completion(documents, nil);
- }];
+ [self.datastore lookupDocuments:keys
+ completion:^(NSArray<FSTMaybeDocument *> *_Nullable documents,
+ NSError *_Nullable error) {
+ if (error) {
+ completion(nil, error);
+ return;
+ }
+ for (FSTMaybeDocument *doc in documents) {
+ NSError *recordError = nil;
+ if (![self recordVersionForDocument:doc error:&recordError]) {
+ completion(nil, recordError);
+ return;
+ }
+ }
+ completion(documents, nil);
+ }];
}
/** Stores mutations to be written when commitWithCompletion is called. */
diff --git a/Firestore/Source/Core/FSTView.m b/Firestore/Source/Core/FSTView.mm
index d6b4558..d6b4558 100644
--- a/Firestore/Source/Core/FSTView.m
+++ b/Firestore/Source/Core/FSTView.mm
diff --git a/Firestore/Source/Core/FSTViewSnapshot.m b/Firestore/Source/Core/FSTViewSnapshot.mm
index e60b785..e60b785 100644
--- a/Firestore/Source/Core/FSTViewSnapshot.m
+++ b/Firestore/Source/Core/FSTViewSnapshot.mm
diff --git a/Firestore/Source/Local/FSTEagerGarbageCollector.m b/Firestore/Source/Local/FSTEagerGarbageCollector.mm
index 77a577e..77a577e 100644
--- a/Firestore/Source/Local/FSTEagerGarbageCollector.m
+++ b/Firestore/Source/Local/FSTEagerGarbageCollector.mm
diff --git a/Firestore/Source/Local/FSTLevelDB.h b/Firestore/Source/Local/FSTLevelDB.h
index 6819116..520557a 100644
--- a/Firestore/Source/Local/FSTLevelDB.h
+++ b/Firestore/Source/Local/FSTLevelDB.h
@@ -16,17 +16,10 @@
#import <Foundation/Foundation.h>
-#import "Firestore/Source/Local/FSTPersistence.h"
-
-#ifdef __cplusplus
#include <memory>
-namespace leveldb {
-class DB;
-class ReadOptions;
-class Status;
-}
-#endif
+#import "Firestore/Source/Local/FSTPersistence.h"
+#include "leveldb/db.h"
@class FSTDatabaseInfo;
@class FSTLocalSerializer;
@@ -69,7 +62,6 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (BOOL)start:(NSError **)error;
-#ifdef __cplusplus
// What follows is the Objective-C++ extension to the API.
/**
* @return A standard set of read options
@@ -103,8 +95,6 @@ NS_ASSUME_NONNULL_BEGIN
/** The native db pointer, allocated during start. */
@property(nonatomic, assign, readonly) std::shared_ptr<leveldb::DB> ptr;
-#endif
-
@end
NS_ASSUME_NONNULL_END
diff --git a/Firestore/Source/Local/FSTLevelDBKey.h b/Firestore/Source/Local/FSTLevelDBKey.h
index e5e7fbb..f3f4bcf 100644
--- a/Firestore/Source/Local/FSTLevelDBKey.h
+++ b/Firestore/Source/Local/FSTLevelDBKey.h
@@ -14,10 +14,6 @@
* limitations under the License.
*/
-#ifndef __cplusplus
-#error "FSTLevelDBKey is Objective-C++ and can only be included from .mm files"
-#endif
-
#import <Foundation/Foundation.h>
#import "Firestore/Source/Core/FSTTypes.h"
diff --git a/Firestore/Source/Local/FSTLevelDBMigrations.h b/Firestore/Source/Local/FSTLevelDBMigrations.h
index 46c7c93..24fb5c8 100644
--- a/Firestore/Source/Local/FSTLevelDBMigrations.h
+++ b/Firestore/Source/Local/FSTLevelDBMigrations.h
@@ -15,14 +15,10 @@
*/
#import <Foundation/Foundation.h>
-#include <memory>
-#ifdef __cplusplus
+#include <memory>
-namespace leveldb {
-class DB;
-}
-#endif
+#include "leveldb/db.h"
NS_ASSUME_NONNULL_BEGIN
diff --git a/Firestore/Source/Local/FSTLevelDBMutationQueue.h b/Firestore/Source/Local/FSTLevelDBMutationQueue.h
index dd2ed4f..cc05db7 100644
--- a/Firestore/Source/Local/FSTLevelDBMutationQueue.h
+++ b/Firestore/Source/Local/FSTLevelDBMutationQueue.h
@@ -16,15 +16,10 @@
#import <Foundation/Foundation.h>
-#import "Firestore/Source/Local/FSTMutationQueue.h"
-
-#ifdef __cplusplus
#include <memory>
-namespace leveldb {
-class DB;
-}
-#endif
+#import "Firestore/Source/Local/FSTMutationQueue.h"
+#include "leveldb/db.h"
@class FSTLevelDB;
@class FSTLocalSerializer;
@@ -41,7 +36,6 @@ NS_ASSUME_NONNULL_BEGIN
/** The garbage collector to notify about potential garbage keys. */
@property(nonatomic, weak, readwrite, nullable) id<FSTGarbageCollector> garbageCollector;
-#ifdef __cplusplus
/**
* Creates a new mutation queue for the given user, in the given LevelDB.
*
@@ -57,7 +51,6 @@ NS_ASSUME_NONNULL_BEGIN
* returns 0. Note that batch IDs are global.
*/
+ (FSTBatchID)loadNextBatchIDFromDB:(std::shared_ptr<leveldb::DB>)db;
-#endif
@end
diff --git a/Firestore/Source/Local/FSTLevelDBQueryCache.h b/Firestore/Source/Local/FSTLevelDBQueryCache.h
index 67c6575..1f6fbd4 100644
--- a/Firestore/Source/Local/FSTLevelDBQueryCache.h
+++ b/Firestore/Source/Local/FSTLevelDBQueryCache.h
@@ -16,38 +16,30 @@
#import <Foundation/Foundation.h>
-#import "Firestore/Source/Local/FSTQueryCache.h"
-
-#ifdef __cplusplus
#include <memory>
-namespace leveldb {
-class DB;
-}
-#endif
+#import "Firestore/Source/Local/FSTQueryCache.h"
+#include "leveldb/db.h"
@class FSTLocalSerializer;
-@protocol FSTGarbageCollector;
@class FSTPBTargetGlobal;
+@protocol FSTGarbageCollector;
NS_ASSUME_NONNULL_BEGIN
/** Cached Queries backed by LevelDB. */
@interface FSTLevelDBQueryCache : NSObject <FSTQueryCache>
-#ifdef __cplusplus
/**
* Retrieves the global singleton metadata row from the given database, if it exists.
*/
+ (nullable FSTPBTargetGlobal *)readTargetMetadataFromDB:(std::shared_ptr<leveldb::DB>)db;
-#endif
- (instancetype)init NS_UNAVAILABLE;
/** The garbage collector to notify about potential garbage keys. */
@property(nonatomic, weak, readwrite, nullable) id<FSTGarbageCollector> garbageCollector;
-#ifdef __cplusplus
/**
* Creates a new query cache in the given LevelDB.
*
@@ -55,7 +47,6 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (instancetype)initWithDB:(std::shared_ptr<leveldb::DB>)db
serializer:(FSTLocalSerializer *)serializer NS_DESIGNATED_INITIALIZER;
-#endif
@end
diff --git a/Firestore/Source/Local/FSTLevelDBRemoteDocumentCache.h b/Firestore/Source/Local/FSTLevelDBRemoteDocumentCache.h
index 1da3cca..20942e2 100644
--- a/Firestore/Source/Local/FSTLevelDBRemoteDocumentCache.h
+++ b/Firestore/Source/Local/FSTLevelDBRemoteDocumentCache.h
@@ -16,15 +16,10 @@
#import <Foundation/Foundation.h>
-#import "Firestore/Source/Local/FSTRemoteDocumentCache.h"
-
-#ifdef __cplusplus
#include <memory>
-namespace leveldb {
-class DB;
-}
-#endif
+#import "Firestore/Source/Local/FSTRemoteDocumentCache.h"
+#include "leveldb/db.h"
@class FSTLocalSerializer;
@@ -35,7 +30,6 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)init NS_UNAVAILABLE;
-#ifdef __cplusplus
/**
* Creates a new remote documents cache in the given leveldb.
*
@@ -43,7 +37,6 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (instancetype)initWithDB:(std::shared_ptr<leveldb::DB>)db
serializer:(FSTLocalSerializer *)serializer NS_DESIGNATED_INITIALIZER;
-#endif
@end
diff --git a/Firestore/Source/Local/FSTLocalDocumentsView.m b/Firestore/Source/Local/FSTLocalDocumentsView.mm
index 0e88958..0e88958 100644
--- a/Firestore/Source/Local/FSTLocalDocumentsView.m
+++ b/Firestore/Source/Local/FSTLocalDocumentsView.mm
diff --git a/Firestore/Source/Local/FSTLocalSerializer.m b/Firestore/Source/Local/FSTLocalSerializer.mm
index 82aec4d..c531c77 100644
--- a/Firestore/Source/Local/FSTLocalSerializer.m
+++ b/Firestore/Source/Local/FSTLocalSerializer.mm
@@ -16,6 +16,8 @@
#import "Firestore/Source/Local/FSTLocalSerializer.h"
+#include <inttypes.h>
+
#import "Firestore/Protos/objc/firestore/local/MaybeDocument.pbobjc.h"
#import "Firestore/Protos/objc/firestore/local/Mutation.pbobjc.h"
#import "Firestore/Protos/objc/firestore/local/Target.pbobjc.h"
diff --git a/Firestore/Source/Local/FSTLocalViewChanges.m b/Firestore/Source/Local/FSTLocalViewChanges.mm
index 9a7f445..9a7f445 100644
--- a/Firestore/Source/Local/FSTLocalViewChanges.m
+++ b/Firestore/Source/Local/FSTLocalViewChanges.mm
diff --git a/Firestore/Source/Local/FSTLocalWriteResult.m b/Firestore/Source/Local/FSTLocalWriteResult.mm
index c1753fe..c1753fe 100644
--- a/Firestore/Source/Local/FSTLocalWriteResult.m
+++ b/Firestore/Source/Local/FSTLocalWriteResult.mm
diff --git a/Firestore/Source/Local/FSTMemoryPersistence.m b/Firestore/Source/Local/FSTMemoryPersistence.mm
index e301820..e301820 100644
--- a/Firestore/Source/Local/FSTMemoryPersistence.m
+++ b/Firestore/Source/Local/FSTMemoryPersistence.mm
diff --git a/Firestore/Source/Local/FSTMemoryQueryCache.m b/Firestore/Source/Local/FSTMemoryQueryCache.mm
index bcab174..bcab174 100644
--- a/Firestore/Source/Local/FSTMemoryQueryCache.m
+++ b/Firestore/Source/Local/FSTMemoryQueryCache.mm
diff --git a/Firestore/Source/Local/FSTMemoryRemoteDocumentCache.m b/Firestore/Source/Local/FSTMemoryRemoteDocumentCache.mm
index 9bbc047..9bbc047 100644
--- a/Firestore/Source/Local/FSTMemoryRemoteDocumentCache.m
+++ b/Firestore/Source/Local/FSTMemoryRemoteDocumentCache.mm
diff --git a/Firestore/Source/Local/FSTNoOpGarbageCollector.m b/Firestore/Source/Local/FSTNoOpGarbageCollector.mm
index e03b599..e03b599 100644
--- a/Firestore/Source/Local/FSTNoOpGarbageCollector.m
+++ b/Firestore/Source/Local/FSTNoOpGarbageCollector.mm
diff --git a/Firestore/Source/Local/FSTQueryData.m b/Firestore/Source/Local/FSTQueryData.mm
index 6bb716a..6bb716a 100644
--- a/Firestore/Source/Local/FSTQueryData.m
+++ b/Firestore/Source/Local/FSTQueryData.mm
diff --git a/Firestore/Source/Local/FSTReferenceSet.m b/Firestore/Source/Local/FSTReferenceSet.mm
index 2acd64b..2acd64b 100644
--- a/Firestore/Source/Local/FSTReferenceSet.m
+++ b/Firestore/Source/Local/FSTReferenceSet.mm
diff --git a/Firestore/Source/Local/FSTRemoteDocumentChangeBuffer.m b/Firestore/Source/Local/FSTRemoteDocumentChangeBuffer.mm
index bca587a..bca587a 100644
--- a/Firestore/Source/Local/FSTRemoteDocumentChangeBuffer.m
+++ b/Firestore/Source/Local/FSTRemoteDocumentChangeBuffer.mm
diff --git a/Firestore/Source/Local/FSTWriteGroup.h b/Firestore/Source/Local/FSTWriteGroup.h
index 5ea0387..c21ff72 100644
--- a/Firestore/Source/Local/FSTWriteGroup.h
+++ b/Firestore/Source/Local/FSTWriteGroup.h
@@ -16,17 +16,10 @@
#import <Foundation/Foundation.h>
-#ifdef __cplusplus
#include <memory>
#include "Firestore/Source/Local/StringView.h"
-
-namespace leveldb {
-class DB;
-class Status;
-}
-
-#endif
+#include "leveldb/db.h"
NS_ASSUME_NONNULL_BEGIN
@@ -61,8 +54,6 @@ NS_ASSUME_NONNULL_BEGIN
/** Returns YES if the write group has no messages in it. */
- (BOOL)isEmpty;
-#ifdef __cplusplus
-
/**
* Marks the given key for deletion.
*
@@ -90,8 +81,6 @@ NS_ASSUME_NONNULL_BEGIN
/** Writes the contents to the given LevelDB. */
- (leveldb::Status)writeToDB:(std::shared_ptr<leveldb::DB>)db;
-#endif
-
@end
NS_ASSUME_NONNULL_END
diff --git a/Firestore/Source/Local/FSTWriteGroupTracker.m b/Firestore/Source/Local/FSTWriteGroupTracker.mm
index 7e3bf60..7e3bf60 100644
--- a/Firestore/Source/Local/FSTWriteGroupTracker.m
+++ b/Firestore/Source/Local/FSTWriteGroupTracker.mm
diff --git a/Firestore/Source/Local/StringView.h b/Firestore/Source/Local/StringView.h
index 8156193..4e36cff 100644
--- a/Firestore/Source/Local/StringView.h
+++ b/Firestore/Source/Local/StringView.h
@@ -17,10 +17,6 @@
#ifndef IPHONE_FIRESTORE_SOURCE_LOCAL_STRING_VIEW_H_
#define IPHONE_FIRESTORE_SOURCE_LOCAL_STRING_VIEW_H_
-#ifndef __cplusplus
-#error "StringView is Objective-C++ and can only be included from .mm files"
-#endif
-
#import <Foundation/Foundation.h>
#include <leveldb/slice.h>
diff --git a/Firestore/Source/Model/FSTDatabaseID.m b/Firestore/Source/Model/FSTDatabaseID.mm
index bff5855..bff5855 100644
--- a/Firestore/Source/Model/FSTDatabaseID.m
+++ b/Firestore/Source/Model/FSTDatabaseID.mm
diff --git a/Firestore/Source/Model/FSTDocument.m b/Firestore/Source/Model/FSTDocument.mm
index bf416e7..bf416e7 100644
--- a/Firestore/Source/Model/FSTDocument.m
+++ b/Firestore/Source/Model/FSTDocument.mm
diff --git a/Firestore/Source/Model/FSTDocumentDictionary.m b/Firestore/Source/Model/FSTDocumentDictionary.mm
index 362af54..362af54 100644
--- a/Firestore/Source/Model/FSTDocumentDictionary.m
+++ b/Firestore/Source/Model/FSTDocumentDictionary.mm
diff --git a/Firestore/Source/Model/FSTDocumentKey.m b/Firestore/Source/Model/FSTDocumentKey.mm
index a382a55..a382a55 100644
--- a/Firestore/Source/Model/FSTDocumentKey.m
+++ b/Firestore/Source/Model/FSTDocumentKey.mm
diff --git a/Firestore/Source/Model/FSTDocumentKeySet.m b/Firestore/Source/Model/FSTDocumentKeySet.mm
index f07b785..f07b785 100644
--- a/Firestore/Source/Model/FSTDocumentKeySet.m
+++ b/Firestore/Source/Model/FSTDocumentKeySet.mm
diff --git a/Firestore/Source/Model/FSTDocumentSet.m b/Firestore/Source/Model/FSTDocumentSet.mm
index c4c0f49..c4c0f49 100644
--- a/Firestore/Source/Model/FSTDocumentSet.m
+++ b/Firestore/Source/Model/FSTDocumentSet.mm
diff --git a/Firestore/Source/Model/FSTDocumentVersionDictionary.m b/Firestore/Source/Model/FSTDocumentVersionDictionary.mm
index 870e082..870e082 100644
--- a/Firestore/Source/Model/FSTDocumentVersionDictionary.m
+++ b/Firestore/Source/Model/FSTDocumentVersionDictionary.mm
diff --git a/Firestore/Source/Model/FSTMutation.m b/Firestore/Source/Model/FSTMutation.mm
index c249138..c249138 100644
--- a/Firestore/Source/Model/FSTMutation.m
+++ b/Firestore/Source/Model/FSTMutation.mm
diff --git a/Firestore/Source/Model/FSTMutationBatch.m b/Firestore/Source/Model/FSTMutationBatch.mm
index 01adca7..01adca7 100644
--- a/Firestore/Source/Model/FSTMutationBatch.m
+++ b/Firestore/Source/Model/FSTMutationBatch.mm
diff --git a/Firestore/Source/Model/FSTPath.m b/Firestore/Source/Model/FSTPath.mm
index 636c322..636c322 100644
--- a/Firestore/Source/Model/FSTPath.m
+++ b/Firestore/Source/Model/FSTPath.mm
diff --git a/Firestore/Source/Remote/FSTBufferedWriter.m b/Firestore/Source/Remote/FSTBufferedWriter.mm
index 47dbb21..47dbb21 100644
--- a/Firestore/Source/Remote/FSTBufferedWriter.m
+++ b/Firestore/Source/Remote/FSTBufferedWriter.mm
diff --git a/Firestore/Source/Remote/FSTDatastore.m b/Firestore/Source/Remote/FSTDatastore.mm
index 02d868c..02d868c 100644
--- a/Firestore/Source/Remote/FSTDatastore.m
+++ b/Firestore/Source/Remote/FSTDatastore.mm
diff --git a/Firestore/Source/Remote/FSTExistenceFilter.m b/Firestore/Source/Remote/FSTExistenceFilter.mm
index d5ec7b3..d5ec7b3 100644
--- a/Firestore/Source/Remote/FSTExistenceFilter.m
+++ b/Firestore/Source/Remote/FSTExistenceFilter.mm
diff --git a/Firestore/Source/Remote/FSTRemoteEvent.m b/Firestore/Source/Remote/FSTRemoteEvent.mm
index a97eb86..88999e4 100644
--- a/Firestore/Source/Remote/FSTRemoteEvent.m
+++ b/Firestore/Source/Remote/FSTRemoteEvent.mm
@@ -278,6 +278,14 @@ initWithSnapshotVersion:(FSTSnapshotVersion *)snapshotVersion
return self;
}
+- (NSDictionary<FSTBoxedTargetID *, FSTTargetChange *> *)targetChanges {
+ return static_cast<NSDictionary<FSTBoxedTargetID *, FSTTargetChange *> *>(_targetChanges);
+}
+
+- (NSDictionary<FSTDocumentKey *, FSTMaybeDocument *> *)documentUpdates {
+ return static_cast<NSDictionary<FSTDocumentKey *, FSTMaybeDocument *> *>(_documentUpdates);
+}
+
/** Adds a document update to this remote event */
- (void)addDocumentUpdate:(FSTMaybeDocument *)document {
_documentUpdates[document.key] = document;
@@ -352,6 +360,10 @@ initWithSnapshotVersion:(FSTSnapshotVersion *)snapshotVersion
return self;
}
+- (NSDictionary<FSTBoxedTargetID *, FSTExistenceFilter *> *)existenceFilters {
+ return static_cast<NSDictionary<FSTBoxedTargetID *, FSTExistenceFilter *> *>(_existenceFilters);
+}
+
- (FSTTargetChange *)targetChangeForTargetID:(FSTBoxedTargetID *)targetID {
FSTTargetChange *change = self.targetChanges[targetID];
if (!change) {
diff --git a/Firestore/Source/Remote/FSTRemoteStore.m b/Firestore/Source/Remote/FSTRemoteStore.mm
index 1201049..123df49 100644
--- a/Firestore/Source/Remote/FSTRemoteStore.m
+++ b/Firestore/Source/Remote/FSTRemoteStore.mm
@@ -16,6 +16,8 @@
#import "Firestore/Source/Remote/FSTRemoteStore.h"
+#include <inttypes.h>
+
#import "Firestore/Source/Core/FSTQuery.h"
#import "Firestore/Source/Core/FSTSnapshotVersion.h"
#import "Firestore/Source/Core/FSTTransaction.h"
diff --git a/Firestore/Source/Remote/FSTSerializerBeta.m b/Firestore/Source/Remote/FSTSerializerBeta.mm
index 04785c2..cf200ca 100644
--- a/Firestore/Source/Remote/FSTSerializerBeta.m
+++ b/Firestore/Source/Remote/FSTSerializerBeta.mm
@@ -16,6 +16,8 @@
#import "Firestore/Source/Remote/FSTSerializerBeta.h"
+#include <inttypes.h>
+
#import <GRPCClient/GRPCCall.h>
#import "Firestore/Protos/objc/google/firestore/v1beta1/Common.pbobjc.h"
@@ -161,41 +163,41 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark - FSTFieldValue <=> Value proto
- (GCFSValue *)encodedFieldValue:(FSTFieldValue *)fieldValue {
- Class class = [fieldValue class];
- if (class == [FSTNullValue class]) {
+ Class fieldClass = [fieldValue class];
+ if (fieldClass == [FSTNullValue class]) {
return [self encodedNull];
- } else if (class == [FSTBooleanValue class]) {
+ } else if (fieldClass == [FSTBooleanValue class]) {
return [self encodedBool:[[fieldValue value] boolValue]];
- } else if (class == [FSTIntegerValue class]) {
+ } else if (fieldClass == [FSTIntegerValue class]) {
return [self encodedInteger:[[fieldValue value] longLongValue]];
- } else if (class == [FSTDoubleValue class]) {
+ } else if (fieldClass == [FSTDoubleValue class]) {
return [self encodedDouble:[[fieldValue value] doubleValue]];
- } else if (class == [FSTStringValue class]) {
+ } else if (fieldClass == [FSTStringValue class]) {
return [self encodedString:[fieldValue value]];
- } else if (class == [FSTTimestampValue class]) {
+ } else if (fieldClass == [FSTTimestampValue class]) {
return [self encodedTimestampValue:((FSTTimestampValue *)fieldValue).internalValue];
- } else if (class == [FSTGeoPointValue class]) {
+ } else if (fieldClass == [FSTGeoPointValue class]) {
return [self encodedGeoPointValue:[fieldValue value]];
- } else if (class == [FSTBlobValue class]) {
+ } else if (fieldClass == [FSTBlobValue class]) {
return [self encodedBlobValue:[fieldValue value]];
- } else if (class == [FSTReferenceValue class]) {
+ } else if (fieldClass == [FSTReferenceValue class]) {
FSTReferenceValue *ref = (FSTReferenceValue *)fieldValue;
return [self encodedReferenceValueForDatabaseID:[ref databaseID] key:[ref value]];
- } else if (class == [FSTObjectValue class]) {
+ } else if (fieldClass == [FSTObjectValue class]) {
GCFSValue *result = [GCFSValue message];
result.mapValue = [self encodedMapValue:(FSTObjectValue *)fieldValue];
return result;
- } else if (class == [FSTArrayValue class]) {
+ } else if (fieldClass == [FSTArrayValue class]) {
GCFSValue *result = [GCFSValue message];
result.arrayValue = [self encodedArrayValue:(FSTArrayValue *)fieldValue];
return result;
@@ -438,8 +440,8 @@ NS_ASSUME_NONNULL_BEGIN
proto.currentDocument.exists = YES;
} else if (mutationClass == [FSTDeleteMutation class]) {
- FSTDeleteMutation *delete = (FSTDeleteMutation *)mutation;
- proto.delete_p = [self encodedDocumentKey:delete.key];
+ FSTDeleteMutation *deleteMutation = (FSTDeleteMutation *)mutation;
+ proto.delete_p = [self encodedDocumentKey:deleteMutation.key];
} else {
FSTFail(@"Unknown mutation type %@", NSStringFromClass(mutationClass));
diff --git a/Firestore/Source/Remote/FSTStream.m b/Firestore/Source/Remote/FSTStream.mm
index dc7d01e..dc7d01e 100644
--- a/Firestore/Source/Remote/FSTStream.m
+++ b/Firestore/Source/Remote/FSTStream.mm
diff --git a/Firestore/Source/Remote/FSTWatchChange.m b/Firestore/Source/Remote/FSTWatchChange.mm
index 926d027..926d027 100644
--- a/Firestore/Source/Remote/FSTWatchChange.m
+++ b/Firestore/Source/Remote/FSTWatchChange.mm
diff --git a/Firestore/Source/Util/FSTAsyncQueryListener.m b/Firestore/Source/Util/FSTAsyncQueryListener.mm
index d98e2dd..d98e2dd 100644
--- a/Firestore/Source/Util/FSTAsyncQueryListener.m
+++ b/Firestore/Source/Util/FSTAsyncQueryListener.mm
diff --git a/Firestore/Source/Util/FSTDispatchQueue.m b/Firestore/Source/Util/FSTDispatchQueue.mm
index 6ce5d74..6ce5d74 100644
--- a/Firestore/Source/Util/FSTDispatchQueue.m
+++ b/Firestore/Source/Util/FSTDispatchQueue.mm
diff --git a/Firestore/Source/Util/FSTLogger.h b/Firestore/Source/Util/FSTLogger.h
index 699570a..c4e2b85 100644
--- a/Firestore/Source/Util/FSTLogger.h
+++ b/Firestore/Source/Util/FSTLogger.h
@@ -18,17 +18,9 @@
NS_ASSUME_NONNULL_BEGIN
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/** Logs to NSLog if [FIRFirestore isLoggingEnabled] is YES. */
void FSTLog(NSString *format, ...) NS_FORMAT_FUNCTION(1, 2);
void FSTWarn(NSString *format, ...) NS_FORMAT_FUNCTION(1, 2);
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
NS_ASSUME_NONNULL_END
diff --git a/Firestore/Source/Util/FSTLogger.m b/Firestore/Source/Util/FSTLogger.mm
index f0081e0..f0081e0 100644
--- a/Firestore/Source/Util/FSTLogger.m
+++ b/Firestore/Source/Util/FSTLogger.mm
diff --git a/Firestore/Source/Util/FSTUsageValidation.h b/Firestore/Source/Util/FSTUsageValidation.h
index 34a3d64..a80dafa 100644
--- a/Firestore/Source/Util/FSTUsageValidation.h
+++ b/Firestore/Source/Util/FSTUsageValidation.h
@@ -18,10 +18,6 @@
NS_ASSUME_NONNULL_BEGIN
-#if __cplusplus
-extern "C" {
-#endif
-
/** Helper for creating a general exception for invalid usage of an API. */
NSException *FSTInvalidUsage(NSString *exceptionName, NSString *format, ...);
@@ -46,8 +42,4 @@ NSException *FSTInvalidUsage(NSString *exceptionName, NSString *format, ...);
@throw FSTInvalidUsage(@"FIRInvalidArgumentException", format, ##__VA_ARGS__); \
} while (0)
-#if __cplusplus
-} // extern "C"
-#endif
-
NS_ASSUME_NONNULL_END
diff --git a/Firestore/Source/Util/FSTUsageValidation.m b/Firestore/Source/Util/FSTUsageValidation.mm
index 82128f4..82128f4 100644
--- a/Firestore/Source/Util/FSTUsageValidation.m
+++ b/Firestore/Source/Util/FSTUsageValidation.mm