From fe03f80b4ed28a4901d6419a150b2ae912c923a5 Mon Sep 17 00:00:00 2001 From: Jack Frankland Date: Sat, 12 Aug 2023 13:49:26 +0100 Subject: fix: Conditionally include `prctl.h` on macos MacOS does not have the `sys/prctl.h` header. This patch conditionally excludes `prctl.h` on MacOS and usage of its functionality in the same way we currently do for windows. Signed-off-by: Jack Frankland Change-Id: Ic56ec358552126b3a10827d9c52db388a8acc214 --- reference_model/src/func_debug.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'reference_model/src') diff --git a/reference_model/src/func_debug.cc b/reference_model/src/func_debug.cc index 7979c89..3ebae59 100644 --- a/reference_model/src/func_debug.cc +++ b/reference_model/src/func_debug.cc @@ -24,7 +24,9 @@ #ifndef _MSC_VER #include +#if !defined(__APPLE__) && !defined(__MACH__) #include +#endif #include #include #include @@ -40,13 +42,13 @@ static bool str_case_equal(const std::string& a, const std::string& b) [](char ac, char bc) { return tolower(ac) == tolower(bc); }); } -#ifndef _MSC_VER +#if !defined(_MSC_VER) && !defined(__APPLE__) && !defined(__MACH__) pid_t func_print_backtrace_helper(int num_tries, int sig); #endif void func_print_backtrace(FILE* out, int sig) { -#ifndef _MSC_VER +#if !defined(_MSC_VER) && !defined(__APPLE__) && !defined(__MACH__) for (int i = 0; i < 2; i++) { const pid_t child_pid = func_print_backtrace_helper(i, sig); @@ -66,7 +68,7 @@ void func_print_backtrace(FILE* out, int sig) #endif } -#ifndef _MSC_VER +#if !defined(_MSC_VER) && !defined(__APPLE__) && !defined(__MACH__) pid_t func_print_backtrace_helper(int num_tries, int sig) { const pid_t child_pid = fork(); -- cgit v1.2.1