diff --git a/sapfor/experts/Sapfor_2017/CMakeLists.txt b/sapfor/experts/Sapfor_2017/CMakeLists.txt index f3f4abf..b06ff45 100644 --- a/sapfor/experts/Sapfor_2017/CMakeLists.txt +++ b/sapfor/experts/Sapfor_2017/CMakeLists.txt @@ -500,6 +500,8 @@ add_definitions("-D __SPF_BUILT_IN_PPPA") if (WIN32) target_link_libraries(Sapfor_F SageNewSrc SageLib SageOldSrc) +elseif(APPLE) + target_link_libraries(Sapfor_F SageNewSrc SageLib SageOldSrc pthread) elseif(UNIX) if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0) target_link_libraries(Sapfor_F SageNewSrc SageLib SageOldSrc pthread stdc++fs) diff --git a/sapfor/experts/Sapfor_2017/_src/ProjectManipulation/StdCapture.h b/sapfor/experts/Sapfor_2017/_src/ProjectManipulation/StdCapture.h index 4867c7a..2878448 100644 --- a/sapfor/experts/Sapfor_2017/_src/ProjectManipulation/StdCapture.h +++ b/sapfor/experts/Sapfor_2017/_src/ProjectManipulation/StdCapture.h @@ -66,7 +66,11 @@ class StdCapture ret = pipe(pipes, 1024 * 1024 * 20, O_BINARY); // 20 MB #else ret = pipe(pipes) == -1; + #ifdef __APPLE__ + fcntl(*pipes, F_PREALLOCATE, 1024 * 1024 * 20); + #else fcntl(*pipes, F_SETPIPE_SZ, 1024 * 1024 * 20); + #endif #endif fd_blocked = (errno == EINTR || errno == EBUSY); if (fd_blocked)