mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-15 07:34:33 +00:00
Remove GetSystemLibraryPaths.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183770 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
add4c2fbb1
commit
40de55a556
@ -111,11 +111,6 @@ namespace sys {
|
|||||||
/// directory.
|
/// directory.
|
||||||
static Path GetTemporaryDirectory(std::string* ErrMsg = 0);
|
static Path GetTemporaryDirectory(std::string* ErrMsg = 0);
|
||||||
|
|
||||||
/// Construct a vector of sys::Path that contains the "standard" system
|
|
||||||
/// library paths suitable for linking into programs.
|
|
||||||
/// @brief Construct a path to the system library directory
|
|
||||||
static void GetSystemLibraryPaths(std::vector<sys::Path>& Paths);
|
|
||||||
|
|
||||||
/// Construct a path to the current user's home directory. The
|
/// Construct a path to the current user's home directory. The
|
||||||
/// implementation must use an operating system specific mechanism for
|
/// implementation must use an operating system specific mechanism for
|
||||||
/// determining the user's home directory. For example, the environment
|
/// determining the user's home directory. For example, the environment
|
||||||
|
@ -95,25 +95,6 @@ bool Path::hasMagicNumber(StringRef Magic) const {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void getPathList(const char*path, std::vector<Path>& Paths) {
|
|
||||||
const char* at = path;
|
|
||||||
const char* delim = strchr(at, PathSeparator);
|
|
||||||
Path tmpPath;
|
|
||||||
while (delim != 0) {
|
|
||||||
std::string tmp(at, size_t(delim-at));
|
|
||||||
if (tmpPath.set(tmp))
|
|
||||||
if (tmpPath.canRead())
|
|
||||||
Paths.push_back(tmpPath);
|
|
||||||
at = delim + 1;
|
|
||||||
delim = strchr(at, PathSeparator);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (*at != 0)
|
|
||||||
if (tmpPath.set(std::string(at)))
|
|
||||||
if (tmpPath.canRead())
|
|
||||||
Paths.push_back(tmpPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
static StringRef getDirnameCharSep(StringRef path, const char *Sep) {
|
static StringRef getDirnameCharSep(StringRef path, const char *Sep) {
|
||||||
assert(Sep[0] != '\0' && Sep[1] == '\0' &&
|
assert(Sep[0] != '\0' && Sep[1] == '\0' &&
|
||||||
"Sep must be a 1-character string literal.");
|
"Sep must be a 1-character string literal.");
|
||||||
|
@ -207,21 +207,6 @@ Path::GetTemporaryDirectory(std::string *ErrMsg) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
Path::GetSystemLibraryPaths(std::vector<sys::Path>& Paths) {
|
|
||||||
#ifdef LTDL_SHLIBPATH_VAR
|
|
||||||
char* env_var = getenv(LTDL_SHLIBPATH_VAR);
|
|
||||||
if (env_var != 0) {
|
|
||||||
getPathList(env_var,Paths);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
// FIXME: Should this look at LD_LIBRARY_PATH too?
|
|
||||||
Paths.push_back(sys::Path("/usr/local/lib/"));
|
|
||||||
Paths.push_back(sys::Path("/usr/X11R6/lib/"));
|
|
||||||
Paths.push_back(sys::Path("/usr/lib/"));
|
|
||||||
Paths.push_back(sys::Path("/lib/"));
|
|
||||||
}
|
|
||||||
|
|
||||||
Path
|
Path
|
||||||
Path::GetUserHomeDirectory() {
|
Path::GetUserHomeDirectory() {
|
||||||
const char* home = getenv("HOME");
|
const char* home = getenv("HOME");
|
||||||
|
@ -241,36 +241,6 @@ Path::GetRootDirectory() {
|
|||||||
return Path("file:///");
|
return Path("file:///");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
Path::GetSystemLibraryPaths(std::vector<sys::Path>& Paths) {
|
|
||||||
char buff[MAX_PATH];
|
|
||||||
// Generic form of C:\Windows\System32
|
|
||||||
HRESULT res = SHGetFolderPathA(NULL,
|
|
||||||
CSIDL_FLAG_CREATE | CSIDL_SYSTEM,
|
|
||||||
NULL,
|
|
||||||
SHGFP_TYPE_CURRENT,
|
|
||||||
buff);
|
|
||||||
if (res != S_OK) {
|
|
||||||
assert(0 && "Failed to get system directory");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Paths.push_back(sys::Path(buff));
|
|
||||||
|
|
||||||
// Reset buff.
|
|
||||||
buff[0] = 0;
|
|
||||||
// Generic form of C:\Windows
|
|
||||||
res = SHGetFolderPathA(NULL,
|
|
||||||
CSIDL_FLAG_CREATE | CSIDL_WINDOWS,
|
|
||||||
NULL,
|
|
||||||
SHGFP_TYPE_CURRENT,
|
|
||||||
buff);
|
|
||||||
if (res != S_OK) {
|
|
||||||
assert(0 && "Failed to get windows directory");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Paths.push_back(sys::Path(buff));
|
|
||||||
}
|
|
||||||
|
|
||||||
Path
|
Path
|
||||||
Path::GetUserHomeDirectory() {
|
Path::GetUserHomeDirectory() {
|
||||||
char buff[MAX_PATH];
|
char buff[MAX_PATH];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user