summaryrefslogtreecommitdiffstats
path: root/Source/kwsys
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2006-01-17 15:21:45 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2006-01-17 15:21:45 (GMT)
commit9891260a6dab66c9ea44b5c2e244f3128625baf5 (patch)
tree930651e4383fe1d904cc9c493bd859cb97b530af /Source/kwsys
parent2694ad76c538333d3ff45613bd1201f97af003cd (diff)
downloadCMake-9891260a6dab66c9ea44b5c2e244f3128625baf5.zip
CMake-9891260a6dab66c9ea44b5c2e244f3128625baf5.tar.gz
CMake-9891260a6dab66c9ea44b5c2e244f3128625baf5.tar.bz2
ENH: add support for watcom wmake and wcl386
Diffstat (limited to 'Source/kwsys')
-rw-r--r--Source/kwsys/Directory.cxx2
-rw-r--r--Source/kwsys/EncodeExecutable.c7
-rw-r--r--Source/kwsys/Glob.cxx2
-rw-r--r--Source/kwsys/ProcessWin32.c3
-rw-r--r--Source/kwsys/Registry.cxx15
-rw-r--r--Source/kwsys/SystemTools.cxx30
-rw-r--r--Source/kwsys/SystemTools.hxx.in1
-rw-r--r--Source/kwsys/kwsysPlatformCxxTests.cxx11
-rw-r--r--Source/kwsys/testRegistry.cxx1
9 files changed, 53 insertions, 19 deletions
diff --git a/Source/kwsys/Directory.cxx b/Source/kwsys/Directory.cxx
index e98c259..fefdab8 100644
--- a/Source/kwsys/Directory.cxx
+++ b/Source/kwsys/Directory.cxx
@@ -74,7 +74,7 @@ const char* Directory::GetFile(unsigned long dindex)
// First microsoft compilers
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__WATCOMC__)
#include <windows.h>
#include <io.h>
#include <ctype.h>
diff --git a/Source/kwsys/EncodeExecutable.c b/Source/kwsys/EncodeExecutable.c
index a0cdcd7..d7c9a45 100644
--- a/Source/kwsys/EncodeExecutable.c
+++ b/Source/kwsys/EncodeExecutable.c
@@ -12,7 +12,9 @@
=========================================================================*/
#include <stdio.h>
-
+#ifdef __WATCOMC__
+#define _unlink unlink
+#endif
int main(int argc, char* argv[])
{
FILE* ifp;
@@ -76,6 +78,9 @@ int main(int argc, char* argv[])
fprintf(ofp, "extern %s_EXPORT int %sEncodedWriteArray%s(const char* fname)\n",
argv[3], argv[3], argv[4]);
fprintf(ofp, "{\n");
+ fprintf(ofp, "#ifdef __WATCOMC__\n");
+ fprintf(ofp, "#define _unlink unlink\n");
+ fprintf(ofp, "#endif\n");
fprintf(ofp, " FILE* ofp = fopen(fname, \"wb\");\n");
fprintf(ofp, " if(!ofp) { return 0; }\n");
for(i=0; i < count; ++i)
diff --git a/Source/kwsys/Glob.cxx b/Source/kwsys/Glob.cxx
index 823f59e..7617458 100644
--- a/Source/kwsys/Glob.cxx
+++ b/Source/kwsys/Glob.cxx
@@ -35,7 +35,7 @@
#include <ctype.h>
#include <stdio.h>
-
+#include <string.h>
namespace KWSYS_NAMESPACE
{
#if defined( _WIN32 ) || defined( APPLE ) || defined( __CYGWIN__ )
diff --git a/Source/kwsys/ProcessWin32.c b/Source/kwsys/ProcessWin32.c
index 6c2fe28..9a0b6eb 100644
--- a/Source/kwsys/ProcessWin32.c
+++ b/Source/kwsys/ProcessWin32.c
@@ -45,6 +45,9 @@ Q190351 and Q150956.
#include <string.h> /* strlen, strdup */
#include <stdio.h> /* sprintf */
#include <io.h> /* _unlink */
+#ifdef __WATCOMC__
+#define _unlink unlink
+#endif
#ifndef _MAX_FNAME
#define _MAX_FNAME 4096
diff --git a/Source/kwsys/Registry.cxx b/Source/kwsys/Registry.cxx
index 97d854d..3c0be26 100644
--- a/Source/kwsys/Registry.cxx
+++ b/Source/kwsys/Registry.cxx
@@ -367,9 +367,7 @@ RegistryHelper::~RegistryHelper()
bool RegistryHelper::Open(const char *toplevel, const char *subkey,
int readonly)
{
- this->EntriesMap.erase(
- this->EntriesMap.begin(),
- this->EntriesMap.end());
+ this->EntriesMap.clear();
m_Empty = 1;
#ifdef _WIN32
@@ -416,7 +414,7 @@ bool RegistryHelper::Open(const char *toplevel, const char *subkey,
}
}
m_HomeDirectory = homeDirectory;
- str << m_HomeDirectory << "/." << toplevel << "rc";
+ str << m_HomeDirectory.c_str() << "/." << toplevel << "rc";
if ( readonly == Registry::READWRITE )
{
kwsys_ios::ofstream ofs( str.str().c_str(), kwsys_ios::ios::out|kwsys_ios::ios::app );
@@ -503,7 +501,7 @@ bool RegistryHelper::Close()
}
kwsys_ios::ostringstream str;
- str << m_HomeDirectory << "/." << this->GetTopLevel() << "rc";
+ str << m_HomeDirectory.c_str() << "/." << this->GetTopLevel() << "rc";
kwsys_ios::ofstream *ofs = new kwsys_ios::ofstream(str.str().c_str(), kwsys_ios::ios::out);
if ( !ofs )
{
@@ -531,9 +529,7 @@ bool RegistryHelper::Close()
*ofs << it->first.c_str() << " = " << this->EncodeValue(it->second.c_str()).c_str() << kwsys_ios::endl;
}
}
- this->EntriesMap.erase(
- this->EntriesMap.begin(),
- this->EntriesMap.end());
+ this->EntriesMap.clear();
ofs->close();
delete ofs;
this->SetSubKey(0);
@@ -673,7 +669,8 @@ kwsys_stl::string RegistryHelper::CreateKey( const char *key )
return "";
}
kwsys_ios::ostringstream ostr;
- ostr << this->EncodeKey(this->m_SubKey.c_str()) << "\\" << this->EncodeKey(key);
+ ostr << this->EncodeKey(this->m_SubKey.c_str()).c_str()
+ << "\\" << this->EncodeKey(key).c_str();
return ostr.str();
}
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index e406723..cd3526c 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -85,7 +85,7 @@ public:
}
#endif
-#if defined(_WIN32) && (defined(_MSC_VER) || defined(__BORLANDC__) || defined(__MINGW32__))
+#if defined(_WIN32) && (defined(_MSC_VER) || defined(__WATCOMC__) ||defined(__BORLANDC__) || defined(__MINGW32__))
#include <io.h>
#include <direct.h>
#define _unlink unlink
@@ -99,8 +99,15 @@ public:
#else
# define KWSYS_SYSTEMTOOLS_MAXPATH 16384
#endif
+#if defined(__WATCOMC__)
+#include <direct.h>
+#define _mkdir mkdir
+#define _rmdir rmdir
+#define _getcwd getcwd
+#define _chdir chdir
+#endif
-#if defined(_WIN32) && (defined(_MSC_VER) || defined(__BORLANDC__) || defined(__MINGW32__))
+#if defined(_WIN32) && (defined(_MSC_VER) || defined(__WATCOMC__) || defined(__BORLANDC__) || defined(__MINGW32__))
inline int Mkdir(const char* dir)
{
return _mkdir(dir);
@@ -1856,7 +1863,11 @@ kwsys_stl::string SystemTools
SystemTools::GetPath(path, "CMAKE_FILE_PATH");
SystemTools::GetPath(path);
// now add the additional paths
- path.insert(path.end(), userPaths.begin(), userPaths.end());
+ for(kwsys_stl::vector<kwsys_stl::string>::const_iterator i = userPaths.begin();
+ i != userPaths.end(); ++i)
+ {
+ path.push_back(*i);
+ }
// now look for the file
kwsys_stl::string tryPath;
for(kwsys_stl::vector<kwsys_stl::string>::const_iterator p = path.begin();
@@ -1911,8 +1922,11 @@ kwsys_stl::string SystemTools::FindProgram(
}
// now add the additional paths
- path.insert(path.end(), userPaths.begin(), userPaths.end());
-
+ for(kwsys_stl::vector<kwsys_stl::string>::const_iterator i = userPaths.begin();
+ i != userPaths.end(); ++i)
+ {
+ path.push_back(*i);
+ }
for(kwsys_stl::vector<kwsys_stl::string>::const_iterator p = path.begin();
p != path.end(); ++p)
{
@@ -1987,7 +2001,11 @@ kwsys_stl::string SystemTools
kwsys_stl::vector<kwsys_stl::string> path;
SystemTools::GetPath(path);
// now add the additional paths
- path.insert(path.end(), userPaths.begin(), userPaths.end());
+ for(kwsys_stl::vector<kwsys_stl::string>::const_iterator i = userPaths.begin();
+ i != userPaths.end(); ++i)
+ {
+ path.push_back(*i);
+ }
kwsys_stl::string tryPath;
for(kwsys_stl::vector<kwsys_stl::string>::const_iterator p = path.begin();
p != path.end(); ++p)
diff --git a/Source/kwsys/SystemTools.hxx.in b/Source/kwsys/SystemTools.hxx.in
index bdc327b..9d5926d 100644
--- a/Source/kwsys/SystemTools.hxx.in
+++ b/Source/kwsys/SystemTools.hxx.in
@@ -18,6 +18,7 @@
#include <@KWSYS_NAMESPACE@/stl/string>
#include <@KWSYS_NAMESPACE@/stl/vector>
#include <@KWSYS_NAMESPACE@/stl/map>
+#include <@KWSYS_NAMESPACE@/stl/algorithm>
#include <@KWSYS_NAMESPACE@/Configure.h>
diff --git a/Source/kwsys/kwsysPlatformCxxTests.cxx b/Source/kwsys/kwsysPlatformCxxTests.cxx
index 77e0d1c..e921676 100644
--- a/Source/kwsys/kwsysPlatformCxxTests.cxx
+++ b/Source/kwsys/kwsysPlatformCxxTests.cxx
@@ -26,7 +26,16 @@ int main() { return 0; }
#ifdef TEST_KWSYS_IOS_USE_SSTREAM
#include <sstream>
-int main() { return 0; }
+int main()
+{
+ std::ostringstream ostr;
+ ostr << "hello";
+ if(ostr.str().size() == 5)
+ {
+ return 0;
+ }
+ return -1;
+}
#endif
#ifdef TEST_KWSYS_IOS_USE_STRSTREAM_H
diff --git a/Source/kwsys/testRegistry.cxx b/Source/kwsys/testRegistry.cxx
index 1c31163..09e9737 100644
--- a/Source/kwsys/testRegistry.cxx
+++ b/Source/kwsys/testRegistry.cxx
@@ -16,6 +16,7 @@
#include KWSYS_HEADER(Registry.hxx)
#include KWSYS_HEADER(ios/iostream)
+#include <string.h>
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.