Fix VC++ compilation errors
authorJeff Cohen <jeffc@jolt-lang.org>
Wed, 15 Dec 2004 04:08:15 +0000 (04:08 +0000)
committerJeff Cohen <jeffc@jolt-lang.org>
Wed, 15 Dec 2004 04:08:15 +0000 (04:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18953 91177308-0d34-0410-b5e6-96231b3b80d8

lib/System/Path.cpp
lib/System/Win32/Path.cpp
lib/System/Win32/Path.inc

index 1c2b00e64566bee521264faa7c5a7a6ddf83030a..dd0f275d7db370ce6ae55a162c4d7287d9bd9b58 100644 (file)
@@ -26,8 +26,10 @@ using namespace sys;
 Path
 Path::GetLLVMConfigDir() {
   Path result;
+#ifdef LLVM_ETCDIR
   if (result.setDirectory(LLVM_ETCDIR))
     return result;
+#endif
   return GetLLVMDefaultConfigDir();
 }
 
index 149b4a1295d0cbe64fda7cfb858432dd44e693f7..24cfc465181e82458d0f18d87c839c6e0cc146a0 100644 (file)
@@ -179,11 +179,6 @@ Path::GetLLVMDefaultConfigDir() {
   return Path("/etc/llvm/");
 }
 
-Path
-Path::GetLLVMConfigDir() {
-  return GetLLVMDefaultConfigDir();
-}
-
 Path
 Path::GetUserHomeDirectory() {
   const char* home = getenv("HOME");
@@ -600,7 +595,7 @@ Path::makeUnique() {
   dir.elideFile();
   std::string fname = this->getLast();
 
-  char* newName = alloca(MAX_PATH+1);
+  char newName[MAX_PATH + 1];
   if (!GetTempFileName(dir.c_str(), fname.c_str(), 0, newName))
     ThrowError("Cannot make unique filename for '" + path + "'");
 
index 149b4a1295d0cbe64fda7cfb858432dd44e693f7..24cfc465181e82458d0f18d87c839c6e0cc146a0 100644 (file)
@@ -179,11 +179,6 @@ Path::GetLLVMDefaultConfigDir() {
   return Path("/etc/llvm/");
 }
 
-Path
-Path::GetLLVMConfigDir() {
-  return GetLLVMDefaultConfigDir();
-}
-
 Path
 Path::GetUserHomeDirectory() {
   const char* home = getenv("HOME");
@@ -600,7 +595,7 @@ Path::makeUnique() {
   dir.elideFile();
   std::string fname = this->getLast();
 
-  char* newName = alloca(MAX_PATH+1);
+  char newName[MAX_PATH + 1];
   if (!GetTempFileName(dir.c_str(), fname.c_str(), 0, newName))
     ThrowError("Cannot make unique filename for '" + path + "'");