Skip to content

Commit 819091b

Browse files
authored
Fix Windows and Fuzzing builds (#5616)
* Add missing dependency on OpenSSL::Crypto This should fix compilation errors about a missing openssl/err.h when building against a prebuilt copy of the library. * Fix Defer usage on Windows * Fix signedness warnings in CountingQueryEngine * Rename status_posix.cc to status_errno.cc Windows excludes *_posix.cc but Status::FromErrno is not conditionally defined. This fixes a missing symbol error when building status tests.
1 parent 3ce3809 commit 819091b

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

Firestore/core/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,13 @@ target_link_libraries(
133133
absl_strings
134134
)
135135

136+
if(HAVE_OPENSSL_RAND_H)
137+
target_link_libraries(
138+
firestore_util PRIVATE
139+
OpenSSL::Crypto
140+
)
141+
endif()
142+
136143
if(APPLE)
137144
target_link_libraries(
138145
firestore_util PUBLIC

Firestore/core/src/util/filesystem_win.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ namespace util {
3737

3838
StatusOr<Path> Filesystem::AppDataDir(absl::string_view app_name) {
3939
wchar_t* path = nullptr;
40-
auto cleanup = defer([&] { CoTaskMemFree(path); });
40+
Defer cleanup([&] { CoTaskMemFree(path); });
4141

4242
HRESULT hr = SHGetKnownFolderPath(FOLDERID_LocalAppData, 0, nullptr, &path);
4343
if (FAILED(hr)) {

Firestore/core/test/unit/local/counting_query_engine.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,15 @@ class CountingQueryEngine : public QueryEngine {
6666
* Returns the number of documents returned by the RemoteDocumentCache's
6767
* `GetMatching()` API (since the last call to `ResetCounts()`)
6868
*/
69-
int documents_read_by_query() const {
69+
size_t documents_read_by_query() const {
7070
return documents_read_by_query_;
7171
}
7272

7373
/**
7474
* Returns the number of documents returned by the RemoteDocumentCache's
7575
* `Get()` and `GetAll()` APIs (since the last call to `ResetCounts()`)
7676
*/
77-
int documents_read_by_key() const {
77+
size_t documents_read_by_key() const {
7878
return documents_read_by_key_;
7979
}
8080

@@ -83,7 +83,7 @@ class CountingQueryEngine : public QueryEngine {
8383
* `getAllMutationBatchesAffectingQuery()` API (since the last call to
8484
* `ResetCounts()`)
8585
*/
86-
int mutations_read_by_query() const {
86+
size_t mutations_read_by_query() const {
8787
return mutations_read_by_query_;
8888
}
8989

@@ -93,7 +93,7 @@ class CountingQueryEngine : public QueryEngine {
9393
* `AllMutationBatchesAffectingDocumentKeys()` APIs (since the last call to
9494
* `ResetCounts()`)
9595
*/
96-
int mutations_read_by_key() const {
96+
size_t mutations_read_by_key() const {
9797
return mutations_read_by_key_;
9898
}
9999

@@ -107,10 +107,10 @@ class CountingQueryEngine : public QueryEngine {
107107
std::unique_ptr<WrappedMutationQueue> mutation_queue_;
108108
std::unique_ptr<WrappedRemoteDocumentCache> remote_documents_;
109109

110-
int mutations_read_by_query_ = 0;
111-
int mutations_read_by_key_ = 0;
112-
int documents_read_by_query_ = 0;
113-
int documents_read_by_key_ = 0;
110+
size_t mutations_read_by_query_ = 0;
111+
size_t mutations_read_by_key_ = 0;
112+
size_t documents_read_by_query_ = 0;
113+
size_t documents_read_by_key_ = 0;
114114
};
115115

116116
/** A MutationQueue that counts document reads. */

0 commit comments

Comments
 (0)