Skip to content

Commit

Permalink
Fix Windows build, part 2
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 703634571
  • Loading branch information
MediaPipe Team authored and copybara-github committed Dec 6, 2024
1 parent 180e7de commit d2e9cae
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions mediapipe/framework/deps/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,16 @@ cc_library(
":file_path",
":mmapped_file",
":platform_strings",
"//mediapipe/framework/formats:unique_fd",
"//mediapipe/framework/port:status",
"@com_google_absl//absl/base:config",
"@com_google_absl//absl/cleanup",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings",
],
] + select({
"//mediapipe:windows": [],
"//conditions:default": ["//mediapipe/framework/formats:unique_fd"],
}),
)

cc_library(
Expand Down
4 changes: 3 additions & 1 deletion mediapipe/framework/deps/file_helpers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@
#include "mediapipe/framework/deps/file_path.h"
#include "mediapipe/framework/deps/mmapped_file.h"
#include "mediapipe/framework/deps/platform_strings.h" // IWYU pragma: keep
#ifndef _WIN32
#include "mediapipe/framework/formats/unique_fd.h"
#endif // !_WIN32
#include "mediapipe/framework/port/status_macros.h"

namespace mediapipe {
Expand Down Expand Up @@ -296,7 +298,7 @@ absl::Status WindowsMMap::Close() {
if (!success) {
return absl::UnavailableError(
absl::StrCat("Failed to close the memory mapping for file '", Path(),
"': " << FormatLastError()));
"': ", FormatLastError()));
}
success = CloseHandle(file_handle_);
if (!success) {
Expand Down
2 changes: 1 addition & 1 deletion mediapipe/framework/deps/mlock_helpers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#ifdef _WIN32
// clang-format off
#include <windows.h> // Must come before other Windows headers
#include <windows.h> // Must come before other Windows headers.
// clang-format on
#include <memoryapi.h>
#else
Expand Down

0 comments on commit d2e9cae

Please sign in to comment.