diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0bf678ec8..6e51dc113 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -64,6 +64,9 @@ set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g") set(CMAKE_CXX_FLAGS_GPROF "-O2 -g -pg") +include(CheckIncludeFileCXX) +check_include_file_cxx("unistd.h" HAVE_UNISTD) + # SPLIT_STACK if ("${SPLIT_STACK}" MATCHES "ON") if ((${CMAKE_SYSTEM_NAME} MATCHES "Linux") AND ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")) diff --git a/src/util/lean_path.cpp b/src/util/lean_path.cpp index 9a59fcdb2..01d8cc382 100644 --- a/src/util/lean_path.cpp +++ b/src/util/lean_path.cpp @@ -219,7 +219,7 @@ optional check_file(std::string const & path, std::string const & f file += ext; std::ifstream ifile(file); if (ifile) - return optional(realpath(file.c_str())); + return optional(lrealpath(file.c_str())); else return optional(); } diff --git a/src/util/realpath.cpp b/src/util/realpath.cpp index d36e54ea0..e98843571 100644 --- a/src/util/realpath.cpp +++ b/src/util/realpath.cpp @@ -7,12 +7,13 @@ Author: Leonardo de Moura #include #include #include "util/realpath.h" + #ifdef LEAN_WINDOWS #include #endif namespace lean { -std::string realpath(char const * fname) { +std::string lrealpath(char const * fname) { #ifdef LEAN_WINDOWS constexpr unsigned BufferSize = 8192; char buffer[BufferSize]; @@ -23,7 +24,7 @@ std::string realpath(char const * fname) { return std::string(buffer); } #else - char * tmp = ::realpath(fname, nullptr); + char * tmp = realpath(fname, nullptr); std::string r(tmp); free(tmp); return r; diff --git a/src/util/realpath.h b/src/util/realpath.h index c7c8735eb..5ebb164eb 100644 --- a/src/util/realpath.h +++ b/src/util/realpath.h @@ -7,5 +7,5 @@ Author: Leonardo de Moura #pragma once #include namespace lean { -std::string realpath(char const * fname); +std::string lrealpath(char const * fname); }