From 377221f22eb64ddee04e9a9c0fcb9eeb59963f3f Mon Sep 17 00:00:00 2001 From: alves Date: Tue, 9 Dec 2025 18:29:46 +0800 Subject: [PATCH] fix mac platform sentry no boost and build failed error bug --- src/sentry_wrapper/SentryWrapper.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/sentry_wrapper/SentryWrapper.cpp b/src/sentry_wrapper/SentryWrapper.cpp index 613ca3dda4..6af78b3b6f 100644 --- a/src/sentry_wrapper/SentryWrapper.cpp +++ b/src/sentry_wrapper/SentryWrapper.cpp @@ -20,6 +20,8 @@ #ifdef __APPLE__ #include #include +#include +#include #endif #include @@ -64,8 +66,11 @@ void initSentryEx() } // Get the directory containing the executable, not the executable path itself - boost::filesystem::path exe_dir = boost::filesystem::path(exe_path).parent_path(); - handlerDir = (exe_dir / "crashpad_handler").string(); + // Use dirname() to get parent directory (need to copy string as dirname may modify it) + char exe_path_copy[PATH_MAX]; + strncpy(exe_path_copy, exe_path, PATH_MAX); + char* exe_dir = dirname(exe_path_copy); + handlerDir = std::string(exe_dir) + "/crashpad_handler"; const char* home_env = getenv("HOME");