FIX: iostream binary flag should be used for cygwin too
This commit is contained in:
parent
4307df12ac
commit
f3a280d7d5
|
@ -969,7 +969,7 @@ bool cmSystemTools::FilesDiffer(const char* source,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||||
std::ifstream finSource(source, std::ios::binary | std::ios::in);
|
std::ifstream finSource(source, std::ios::binary | std::ios::in);
|
||||||
std::ifstream finDestination(destination, std::ios::binary | std::ios::in);
|
std::ifstream finDestination(destination, std::ios::binary | std::ios::in);
|
||||||
#else
|
#else
|
||||||
|
@ -1016,11 +1016,11 @@ void cmSystemTools::cmCopyFile(const char* source,
|
||||||
const int bufferSize = 4096;
|
const int bufferSize = 4096;
|
||||||
char buffer[bufferSize];
|
char buffer[bufferSize];
|
||||||
|
|
||||||
std::ifstream fin(source,
|
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||||
#ifdef _WIN32
|
std::ifstream fin(source, std::ios::binary | std::ios::in);
|
||||||
std::ios::binary |
|
#else
|
||||||
|
std::ifstream fin(source);
|
||||||
#endif
|
#endif
|
||||||
std::ios::in);
|
|
||||||
if(!fin)
|
if(!fin)
|
||||||
{
|
{
|
||||||
cmSystemTools::Error("CopyFile failed to open input file \"",
|
cmSystemTools::Error("CopyFile failed to open input file \"",
|
||||||
|
@ -1051,11 +1051,11 @@ void cmSystemTools::cmCopyFile(const char* source,
|
||||||
destination_dir = cmSystemTools::GetFilenamePath(destination_dir);
|
destination_dir = cmSystemTools::GetFilenamePath(destination_dir);
|
||||||
cmSystemTools::MakeDirectory(destination_dir.c_str());
|
cmSystemTools::MakeDirectory(destination_dir.c_str());
|
||||||
|
|
||||||
std::ofstream fout(dest,
|
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||||
#ifdef _WIN32
|
std::ofstream fout(dest, std::ios::binary | std::ios::out | std::ios::trunc);
|
||||||
std::ios::binary |
|
#else
|
||||||
|
std::ofstream fout(dest, std::ios::out | std::ios::trunc);
|
||||||
#endif
|
#endif
|
||||||
std::ios::out | std::ios::trunc);
|
|
||||||
if(!fout)
|
if(!fout)
|
||||||
{
|
{
|
||||||
cmSystemTools::Error("CopyFile failed to open output file \"",
|
cmSystemTools::Error("CopyFile failed to open output file \"",
|
||||||
|
|
Loading…
Reference in New Issue