Skip to content

Commit edad366

Browse files
authored
Remove unnecessary guard around FieldValue::Increment. (#554)
* Remove unnecessary guard around FieldValue::Increment. Firestore has been building with INTERNAL_EXPERIMENTAL=1 for quite some time. These methods should always be exposed. Test coverage for them is available in field_value_test.cc and numeric_transforms_test.cc. * Add release note to readme.md.
1 parent 5fc5f9b commit edad366

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

firestore/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,8 @@ add_custom_target(
342342
COMMENT "Copying internal Firestore headers"
343343
)
344344

345+
# This is needed due to Firestore's dependence on some firebase::app APIs that
346+
# are guarded by this flag, such as GetUserAgent and function_registry.
345347
set(FIREBASE_FIRESTORE_CPP_DEFINES -DINTERNAL_EXPERIMENTAL=1)
346348

347349
if (WIN32 AND NOT ANDROID AND NOT IOS)

firestore/src/include/firebase/firestore/field_value.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,6 @@ class FieldValue final {
325325
*/
326326
static FieldValue ArrayRemove(std::vector<FieldValue> elements);
327327

328-
#if defined(INTERNAL_EXPERIMENTAL) || defined(SWIG)
329328
/**
330329
* Returns a special value that can be used with `Set()` or `Update()` that
331330
* tells the server to increment the field's current value by the given
@@ -355,9 +354,6 @@ class FieldValue final {
355354
return IntegerIncrement(static_cast<int64_t>(by_value));
356355
}
357356

358-
#endif // if defined(INTERNAL_EXPERIMENTAL) || defined(SWIG)
359-
360-
#if defined(INTERNAL_EXPERIMENTAL) || defined(SWIG)
361357
/**
362358
* Returns a special value that can be used with `Set()` or `Update()` that
363359
* tells the server to increment the field's current value by the given
@@ -388,8 +384,6 @@ class FieldValue final {
388384
return DoubleIncrement(static_cast<double>(by_value));
389385
}
390386

391-
#endif // if defined(INTERNAL_EXPERIMENTAL) || defined(SWIG)
392-
393387
/**
394388
* Returns a string representation of this `FieldValue` for logging/debugging
395389
* purposes.

release_build_files/readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,8 @@ code.
572572
- Firestore: Removed the deprecated
573573
`Firestore::RunTransaction(TransactionFunction*)` function. Please use
574574
the overload that takes a `std::function` argument instead.
575+
- Firestore: `FieldValue::Increment` functions are no longer guarded by
576+
the `INTERNAL_EXPERIMENTAL` macro.
575577

576578
### 8.2.0
577579
- Changes

0 commit comments

Comments
 (0)