diff options
author | Jeff Cohen <jeffc@jolt-lang.org> | 2004-12-24 02:38:34 +0000 |
---|---|---|
committer | Jeff Cohen <jeffc@jolt-lang.org> | 2004-12-24 02:38:34 +0000 |
commit | d567bb6af69abdb1677b5fd33e596f910bf0193f (patch) | |
tree | 509055002e289c460840c1bd5af1e9ec28759966 /llvm | |
parent | 657b7343f3d57a04459a587601e8c6a9bcf276c5 (diff) | |
download | bcm5719-llvm-d567bb6af69abdb1677b5fd33e596f910bf0193f.tar.gz bcm5719-llvm-d567bb6af69abdb1677b5fd33e596f910bf0193f.zip |
Fix VC++ compilation error
llvm-svn: 19124
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/lib/System/Win32/Path.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/System/Win32/Path.cpp b/llvm/lib/System/Win32/Path.cpp index c50877afb1a..9377c426454 100644 --- a/llvm/lib/System/Win32/Path.cpp +++ b/llvm/lib/System/Win32/Path.cpp @@ -23,6 +23,9 @@ #include <fstream> #include <malloc.h> +// We need to undo a macro defined in Windows.h, otherwise we won't compile: +#undef CopyFile + static void FlipBackSlashes(std::string& s) { for (size_t i = 0; i < s.size(); i++) if (s[i] == '\\') @@ -574,13 +577,15 @@ bool Path::getMagicNumber(std::string& Magic, unsigned len) const { void sys::CopyFile(const sys::Path &Dest, const sys::Path &Src) { - if (!::CopyFile(Src.c_str(), Dest.c_str(), false)) + // Can't use CopyFile macro defined in Windows.h because it would mess up the + // above line. We use the expansion it would have in a non-UNICODE build. + if (!::CopyFileA(Src.c_str(), Dest.c_str(), false)) ThrowError("Can't copy '" + Src.toString() + "' to '" + Dest.toString() + "'"); } void -Path::makeUnique( bool reuse_current ) { +Path::makeUnique(bool reuse_current) { if (reuse_current && !exists()) return; // File doesn't exist already, just use it! |