fix(util/realpath): rename realpath to lrealpath
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
bc4cef9ecb
commit
53c7124c2b
4 changed files with 8 additions and 4 deletions
|
@ -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"))
|
||||
|
|
|
@ -219,7 +219,7 @@ optional<std::string> check_file(std::string const & path, std::string const & f
|
|||
file += ext;
|
||||
std::ifstream ifile(file);
|
||||
if (ifile)
|
||||
return optional<std::string>(realpath(file.c_str()));
|
||||
return optional<std::string>(lrealpath(file.c_str()));
|
||||
else
|
||||
return optional<std::string>();
|
||||
}
|
||||
|
|
|
@ -7,12 +7,13 @@ Author: Leonardo de Moura
|
|||
#include <string>
|
||||
#include <cstdlib>
|
||||
#include "util/realpath.h"
|
||||
|
||||
#ifdef LEAN_WINDOWS
|
||||
#include <windows.h>
|
||||
#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;
|
||||
|
|
|
@ -7,5 +7,5 @@ Author: Leonardo de Moura
|
|||
#pragma once
|
||||
#include <string>
|
||||
namespace lean {
|
||||
std::string realpath(char const * fname);
|
||||
std::string lrealpath(char const * fname);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue