Skip to content

Commit 4a7b353

Browse files
andycallclaude
andcommitted
fix: fix Windows compilation errors in test files
- Add missing #include <combaseapi.h> for CoTaskMemAlloc on Windows - Guard execinfo.h, unistd.h and backtrace calls with #ifndef _WIN32 as these are Unix-only APIs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5a2ba0d commit 4a7b353

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

bridge/foundation/shared_ui_command_test.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
#include <chrono>
1414
#include <atomic>
1515
#include <vector>
16+
#if defined(_WIN32)
17+
#include <combaseapi.h>
18+
#endif
1619

1720
using namespace webf;
1821

bridge/webf_bridge_test.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
*/
55

66
#include "webf_bridge_test.h"
7+
#ifndef _WIN32
78
#include <execinfo.h>
8-
#include <signal.h>
99
#include <unistd.h>
10+
#endif
11+
#include <signal.h>
1012
#include <atomic>
1113
#include "bindings/qjs/native_string_utils.h"
1214
#include "logging.h"
@@ -15,6 +17,7 @@
1517
std::unordered_map<int, webf::WebFTestContext*> testContextPool = std::unordered_map<int, webf::WebFTestContext*>();
1618

1719
void handler(int sig) {
20+
#ifndef _WIN32
1821
void* array[10];
1922
size_t size;
2023

@@ -24,6 +27,9 @@ void handler(int sig) {
2427
// print out all the frames to stderr
2528
fprintf(stderr, "Error: signal %d:\n", sig);
2629
backtrace_symbols_fd(array, size, STDERR_FILENO);
30+
#else
31+
fprintf(stderr, "Error: signal %d\n", sig);
32+
#endif
2733
exit(1);
2834
}
2935

0 commit comments

Comments
 (0)