summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastien Barre <sebastien.barre@kitware.com>2002-04-12 16:05:01 (GMT)
committerSebastien Barre <sebastien.barre@kitware.com>2002-04-12 16:05:01 (GMT)
commitf3a280d7d5c48b5722775232efbadee55d2e2e26 (patch)
tree82174446971f5060c7c7fccf4876d5447ef22f76
parent4307df12ac97a9eca56593aea9871d094fa506f6 (diff)
downloadCMake-f3a280d7d5c48b5722775232efbadee55d2e2e26.zip
CMake-f3a280d7d5c48b5722775232efbadee55d2e2e26.tar.gz
CMake-f3a280d7d5c48b5722775232efbadee55d2e2e26.tar.bz2
FIX: iostream binary flag should be used for cygwin too
-rw-r--r--Source/cmSystemTools.cxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index fb540bc..7c43794 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -969,7 +969,7 @@ bool cmSystemTools::FilesDiffer(const char* source,
return true;
}
-#ifdef _WIN32
+#if defined(_WIN32) || defined(__CYGWIN__)
std::ifstream finSource(source, std::ios::binary | std::ios::in);
std::ifstream finDestination(destination, std::ios::binary | std::ios::in);
#else
@@ -1016,11 +1016,11 @@ void cmSystemTools::cmCopyFile(const char* source,
const int bufferSize = 4096;
char buffer[bufferSize];
- std::ifstream fin(source,
-#ifdef _WIN32
- std::ios::binary |
+#if defined(_WIN32) || defined(__CYGWIN__)
+ std::ifstream fin(source, std::ios::binary | std::ios::in);
+#else
+ std::ifstream fin(source);
#endif
- std::ios::in);
if(!fin)
{
cmSystemTools::Error("CopyFile failed to open input file \"",
@@ -1051,11 +1051,11 @@ void cmSystemTools::cmCopyFile(const char* source,
destination_dir = cmSystemTools::GetFilenamePath(destination_dir);
cmSystemTools::MakeDirectory(destination_dir.c_str());
- std::ofstream fout(dest,
-#ifdef _WIN32
- std::ios::binary |
+#if defined(_WIN32) || defined(__CYGWIN__)
+ std::ofstream fout(dest, std::ios::binary | std::ios::out | std::ios::trunc);
+#else
+ std::ofstream fout(dest, std::ios::out | std::ios::trunc);
#endif
- std::ios::out | std::ios::trunc);
if(!fout)
{
cmSystemTools::Error("CopyFile failed to open output file \"",