From fa042e42ed8b5c0a6abcd072d4ae5bd44ee4d922 Mon Sep 17 00:00:00 2001 From: Petter Reinholdtsen Date: Sat, 18 Apr 2026 10:25:11 +0200 Subject: [PATCH] Corrected #ifdef for mach based Apple builds in cadical_file.cpp. Bring test in line with all other tests for mach based MacOS builds, and ensure the code in question is not enabled with mach on GNU Hurd. --- src/sat/cadical/cadical_file.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/sat/cadical/cadical_file.cpp b/src/sat/cadical/cadical_file.cpp index d48193e93..c4225dbeb 100644 --- a/src/sat/cadical/cadical_file.cpp +++ b/src/sat/cadical/cadical_file.cpp @@ -41,7 +41,7 @@ extern "C" { #endif -#if defined(__APPLE__) || defined(__MACH__) +#if defined(__APPLE__) && defined(__MACH__) extern "C" { #include @@ -293,7 +293,7 @@ FILE *File::read_pipe (Internal *internal, const char *fmt, const int *sig, #if !defined(_WIN32) && !defined(__wasm) -#if defined(__APPLE__) || defined(__MACH__) +#if defined(__APPLE__) && defined(__MACH__) static std::mutex compressed_file_writing_mutex; #endif @@ -312,7 +312,7 @@ FILE *File::write_pipe (Internal *internal, const char *command, char *absolute_command_path = find_program (argv[0]); int pipe_fds[2], out; FILE *res = 0; -#if defined(__APPLE__) || defined(__MACH__) +#if defined(__APPLE__) && defined(__MACH__) compressed_file_writing_mutex.lock (); #endif if (!absolute_command_path) @@ -369,7 +369,7 @@ FILE *File::write_pipe (Internal *internal, const char *command, #ifdef CADICAL_QUIET (void) internal; #endif -#if defined(__APPLE__) || defined(__MACH__) +#if defined(__APPLE__) && defined(__MACH__) if (!res) compressed_file_writing_mutex.unlock (); #endif @@ -475,7 +475,7 @@ void File::close (bool print) { MSG ("closing output pipe to write '%s'", name ()); fclose (file); waitpid (child_pid, 0, 0); -#if defined(__APPLE__) || defined(__MACH__) +#if defined(__APPLE__) && defined(__MACH__) compressed_file_writing_mutex.unlock (); #endif }