Merge pull request #498 from petterreinholdtsen/mach-only-apple

Corrected #ifdef for mach based Apple builds in cadical_file.cpp.
This commit is contained in:
alanminko 2026-05-02 21:21:43 -07:00 committed by GitHub
commit 84b78d570c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 5 deletions

View File

@ -41,7 +41,7 @@ extern "C" {
#endif
#if defined(__APPLE__) || defined(__MACH__)
#if defined(__APPLE__) && defined(__MACH__)
extern "C" {
#include <libproc.h>
@ -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
}