mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-28 04:33:05 +00:00
Fix VC++ compilation error
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19124 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e32beb78d5
commit
cb652550b6
@ -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!
|
||||
|
||||
|
@ -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!
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user