diff options
author | Gil <mcg@google.com> | 2018-07-11 15:27:50 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-11 15:27:50 -0700 |
commit | e1ace703fbf4458d9e887ebf30050b1a0482a2d2 (patch) | |
tree | 63537e388b8d16a5625eedce0937cb50bf69d4c7 /Firestore/core/src/firebase/firestore/util/hard_assert.h | |
parent | 79f663d5eaaa4b7f9fe46d176c82660d38e4be8a (diff) |
Fix Firestore source errors under VS2017 (#1515)
* Project file updates from sync_project.rb
* Fix misc compile errors under VS2017
* Fix util/hashing under VS2017
std::hash<int> is not just a pass through in Microsoft's STL.
* Disable unsafe code warnings in VS2017
... where comparing against a reference implementation that has no easy
safe equivalent.
* Handle drive letters in paths on Windows
Diffstat (limited to 'Firestore/core/src/firebase/firestore/util/hard_assert.h')
-rw-r--r-- | Firestore/core/src/firebase/firestore/util/hard_assert.h | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/Firestore/core/src/firebase/firestore/util/hard_assert.h b/Firestore/core/src/firebase/firestore/util/hard_assert.h index e60d71a..7b66f33 100644 --- a/Firestore/core/src/firebase/firestore/util/hard_assert.h +++ b/Firestore/core/src/firebase/firestore/util/hard_assert.h @@ -21,6 +21,12 @@ #include "Firestore/core/src/firebase/firestore/util/string_format.h" +#if defined(_MSC_VER) +#define FIRESTORE_FUNCTION_NAME __FUNCSIG__ +#else +#define FIRESTORE_FUNCTION_NAME __PRETTY_FUNCTION__ +#endif + /** * Fails the current function if the given condition is false. * @@ -30,14 +36,14 @@ * @param format (optional) A format string suitable for util::StringFormat. * @param ... format arguments to pass to util::StringFormat. */ -#define HARD_ASSERT(condition, ...) \ - do { \ - if (!(condition)) { \ - std::string _message = \ - firebase::firestore::util::StringFormat(__VA_ARGS__); \ - firebase::firestore::util::internal::Fail( \ - __FILE__, __PRETTY_FUNCTION__, __LINE__, _message, #condition); \ - } \ +#define HARD_ASSERT(condition, ...) \ + do { \ + if (!(condition)) { \ + std::string _message = \ + firebase::firestore::util::StringFormat(__VA_ARGS__); \ + firebase::firestore::util::internal::Fail( \ + __FILE__, FIRESTORE_FUNCTION_NAME, __LINE__, _message, #condition); \ + } \ } while (0) /** @@ -48,12 +54,12 @@ * @param format A format string suitable for util::StringFormat. * @param ... format arguments to pass to util::StringFormat. */ -#define HARD_FAIL(...) \ - do { \ - std::string _failure = \ - firebase::firestore::util::StringFormat(__VA_ARGS__); \ - firebase::firestore::util::internal::Fail(__FILE__, __PRETTY_FUNCTION__, \ - __LINE__, _failure); \ +#define HARD_FAIL(...) \ + do { \ + std::string _failure = \ + firebase::firestore::util::StringFormat(__VA_ARGS__); \ + firebase::firestore::util::internal::Fail( \ + __FILE__, FIRESTORE_FUNCTION_NAME, __LINE__, _failure); \ } while (0) /** |