Skip to content

Commit 9889ac9

Browse files
cynthiajoanCynthia Jiang
andauthored
add -DNOMINMAX to both WIN32 and WIN64 (#810)
* add -DNOMINMAX to both WIN32 and WIN64 * test * test * test * test * remove helper print * format code Co-authored-by: Cynthia Jiang <[email protected]>
1 parent 668d132 commit 9889ac9

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

firestore/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ add_custom_target(
347347
# are guarded by this flag, such as GetUserAgent and function_registry.
348348
set(FIREBASE_FIRESTORE_CPP_DEFINES -DINTERNAL_EXPERIMENTAL=1)
349349

350-
if (WIN32 AND NOT ANDROID AND NOT IOS)
350+
if (MSVC AND NOT ANDROID AND NOT IOS)
351351
# On Windows, gRPC gives a compiler error in firebase_metadata_provider_desktop.cc
352352
# unless _WIN32_WINNT is defined to this value (0x0600, Windows Vista).
353353
# Also set -DNOMINMAX for both Firestore and Firestore Core.

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,8 @@ class FieldValue final {
348348
// Note: Doxygen will run into trouble if this function's definition is
349349
// moved outside the class body.
350350
static_assert(
351-
std::numeric_limits<T>::max() <= std::numeric_limits<int64_t>::max(),
351+
(std::numeric_limits<T>::max)() <=
352+
(std::numeric_limits<int64_t>::max)(),
352353
"The integer type you provided is larger than can fit in an int64_t. "
353354
"If you are sure the value will not be truncated, please explicitly "
354355
"cast to int64_t before passing it to FieldValue::Increment().");
@@ -377,7 +378,7 @@ class FieldValue final {
377378
// Note: Doxygen will run into trouble if this function's definition is
378379
// moved outside the class body.
379380
static_assert(
380-
std::numeric_limits<T>::max() <= std::numeric_limits<double>::max(),
381+
(std::numeric_limits<T>::max)() <= (std::numeric_limits<double>::max)(),
381382
"The floating point type you provided is larger than can fit in a "
382383
"double. If you are sure the value will not be truncated, please "
383384
"explicitly cast to double before passing it to "

0 commit comments

Comments
 (0)