Merge branch 'upstream-kwsys' into update-kwsys

This commit is contained in:
Brad King 2013-01-08 08:42:58 -05:00
commit 6f6afbd69f
9 changed files with 641 additions and 602 deletions

View File

@ -596,6 +596,13 @@ IF(KWSYS_USE_SystemInformation)
ENDIF() ENDIF()
ENDIF() ENDIF()
ENDIF() ENDIF()
IF(CMAKE_SYSTEM MATCHES "HP-UX")
CHECK_INCLUDE_FILES("sys/mpctl.h" KWSYS_SYS_HAS_MPCTL_H)
IF(KWSYS_SYS_HAS_MPCTL_H)
SET_PROPERTY(SOURCE SystemInformation.cxx APPEND PROPERTY
COMPILE_DEFINITIONS KWSYS_SYS_HAS_MPCTL_H=1)
ENDIF()
ENDIF()
IF(KWSYS_LFS_AVAILABLE AND NOT KWSYS_LFS_DISABLE) IF(KWSYS_LFS_AVAILABLE AND NOT KWSYS_LFS_DISABLE)
SET(KWSYS_PLATFORM_CXX_TEST_DEFINES -DKWSYS_HAS_LFS=1) SET(KWSYS_PLATFORM_CXX_TEST_DEFINES -DKWSYS_HAS_LFS=1)
ENDIF() ENDIF()

View File

@ -26,12 +26,9 @@
/* Whether ostream supports long long. */ /* Whether ostream supports long long. */
#define @KWSYS_NAMESPACE@_IOS_HAS_OSTREAM_LONG_LONG @KWSYS_IOS_HAS_OSTREAM_LONG_LONG@ #define @KWSYS_NAMESPACE@_IOS_HAS_OSTREAM_LONG_LONG @KWSYS_IOS_HAS_OSTREAM_LONG_LONG@
/* Size of type long long and 0 if not available. */
#define @KWSYS_NAMESPACE@_IOS_SIZEOF_LONG_LONG @KWSYS_SIZEOF_LONG_LONG@
/* Determine whether we need to define the streaming operators for /* Determine whether we need to define the streaming operators for
long long or __int64. */ long long or __int64. */
#if @KWSYS_NAMESPACE@_IOS_SIZEOF_LONG_LONG #if @KWSYS_USE_LONG_LONG@
# if !@KWSYS_NAMESPACE@_IOS_HAS_ISTREAM_LONG_LONG || \ # if !@KWSYS_NAMESPACE@_IOS_HAS_ISTREAM_LONG_LONG || \
!@KWSYS_NAMESPACE@_IOS_HAS_OSTREAM_LONG_LONG !@KWSYS_NAMESPACE@_IOS_HAS_OSTREAM_LONG_LONG
# define @KWSYS_NAMESPACE@_IOS_NEED_OPERATORS_LL 1 # define @KWSYS_NAMESPACE@_IOS_NEED_OPERATORS_LL 1
@ -136,7 +133,6 @@ operator<<(kwsys_ios::ostream& os, @KWSYS_NAMESPACE@::IOStreamULL value)
/* If building a C++ file in kwsys itself, give the source file /* If building a C++ file in kwsys itself, give the source file
access to the macros without a configured namespace. */ access to the macros without a configured namespace. */
#if defined(KWSYS_NAMESPACE) #if defined(KWSYS_NAMESPACE)
# define KWSYS_IOS_SIZEOF_LONG_LONG @KWSYS_NAMESPACE@_IOS_SIZEOF_LONG_LONG
# define KWSYS_IOS_HAS_ISTREAM_LONG_LONG @KWSYS_NAMESPACE@_IOS_HAS_ISTREAM_LONG_LONG # define KWSYS_IOS_HAS_ISTREAM_LONG_LONG @KWSYS_NAMESPACE@_IOS_HAS_ISTREAM_LONG_LONG
# define KWSYS_IOS_HAS_OSTREAM_LONG_LONG @KWSYS_NAMESPACE@_IOS_HAS_OSTREAM_LONG_LONG # define KWSYS_IOS_HAS_OSTREAM_LONG_LONG @KWSYS_NAMESPACE@_IOS_HAS_OSTREAM_LONG_LONG
# define KWSYS_IOS_NEED_OPERATORS_LL @KWSYS_NAMESPACE@_IOS_NEED_OPERATORS_LL # define KWSYS_IOS_NEED_OPERATORS_LL @KWSYS_NAMESPACE@_IOS_NEED_OPERATORS_LL

View File

@ -63,10 +63,6 @@ do.
#include <dirent.h> /* DIR, dirent */ #include <dirent.h> /* DIR, dirent */
#include <ctype.h> /* isspace */ #include <ctype.h> /* isspace */
#ifdef __HAIKU__
#undef __BEOS__
#endif
#if defined(__VMS) #if defined(__VMS)
# define KWSYSPE_VMS_NONBLOCK , O_NONBLOCK # define KWSYSPE_VMS_NONBLOCK , O_NONBLOCK
#else #else

File diff suppressed because it is too large Load Diff

View File

@ -157,7 +157,7 @@ public:
#include <os/storage/Path.h> #include <os/storage/Path.h>
#endif #endif
#if defined(__BEOS__) && !defined(__ZETA__) && !defined(__HAIKU__) #if defined(__BEOS__) && !defined(__ZETA__)
#include <be/kernel/OS.h> #include <be/kernel/OS.h>
#include <be/storage/Path.h> #include <be/storage/Path.h>
@ -622,11 +622,7 @@ bool SystemTools::MakeDirectory(const char* path)
} }
SystemTools::ConvertToUnixSlashes(dir); SystemTools::ConvertToUnixSlashes(dir);
kwsys_stl::string::size_type pos = dir.find(':'); kwsys_stl::string::size_type pos = 0;
if(pos == kwsys_stl::string::npos)
{
pos = 0;
}
kwsys_stl::string topdir; kwsys_stl::string topdir;
while((pos = dir.find('/', pos)) != kwsys_stl::string::npos) while((pos = dir.find('/', pos)) != kwsys_stl::string::npos)
{ {
@ -634,14 +630,7 @@ bool SystemTools::MakeDirectory(const char* path)
Mkdir(topdir.c_str()); Mkdir(topdir.c_str());
pos++; pos++;
} }
if(dir[dir.size()-1] == '/')
{
topdir = dir.substr(0, dir.size());
}
else
{
topdir = dir; topdir = dir;
}
if(Mkdir(topdir.c_str()) != 0) if(Mkdir(topdir.c_str()) != 0)
{ {
// There is a bug in the Borland Run time library which makes MKDIR // There is a bug in the Borland Run time library which makes MKDIR
@ -4054,7 +4043,7 @@ kwsys_stl::string SystemTools::GetCurrentDateTime(const char* format)
return kwsys_stl::string(buf); return kwsys_stl::string(buf);
} }
kwsys_stl::string SystemTools::MakeCindentifier(const char* s) kwsys_stl::string SystemTools::MakeCidentifier(const char* s)
{ {
kwsys_stl::string str(s); kwsys_stl::string str(s);
if (str.find_first_of("0123456789") == 0) if (str.find_first_of("0123456789") == 0)

View File

@ -91,7 +91,12 @@ public:
* then an underscore is prepended. Note that this can produce * then an underscore is prepended. Note that this can produce
* identifiers that the standard reserves (_[A-Z].* and __.*). * identifiers that the standard reserves (_[A-Z].* and __.*).
*/ */
static kwsys_stl::string MakeCindentifier(const char* s); static kwsys_stl::string MakeCidentifier(const char* s);
static kwsys_stl::string MakeCindentifier(const char* s)
{
return MakeCidentifier(s);
}
/** /**
* Replace replace all occurences of the string in the source string. * Replace replace all occurences of the string in the source string.

View File

@ -15,7 +15,7 @@
#include KWSYS_HEADER(ios/iostream) #include KWSYS_HEADER(ios/iostream)
#include KWSYS_HEADER(stl/string) #include KWSYS_HEADER(stl/string)
#if defined(__BEOS__) && !defined(__HAIKU__) #if defined(__BEOS__)
#include <be/kernel/OS.h> /* disable_debugger() API. */ #include <be/kernel/OS.h> /* disable_debugger() API. */
#endif #endif

View File

@ -32,7 +32,7 @@
# pragma warn -8060 /* possibly incorrect assignment */ # pragma warn -8060 /* possibly incorrect assignment */
#endif #endif
#if defined(__BEOS__) && !defined(__ZETA__) && !defined(__HAIKU__) #if defined(__BEOS__) && !defined(__ZETA__)
/* BeOS 5 doesn't have usleep(), but it has snooze(), which is identical. */ /* BeOS 5 doesn't have usleep(), but it has snooze(), which is identical. */
# include <be/kernel/OS.h> # include <be/kernel/OS.h>
static inline void testProcess_usleep(unsigned int msec) static inline void testProcess_usleep(unsigned int msec)

View File

@ -47,6 +47,8 @@
int testSystemInformation(int, char*[]) int testSystemInformation(int, char*[])
{ {
kwsys_ios::cout << "CTEST_FULL_OUTPUT\n"; // avoid truncation
kwsys::SystemInformation info; kwsys::SystemInformation info;
info.RunCPUCheck(); info.RunCPUCheck();
info.RunOSCheck(); info.RunOSCheck();
@ -86,6 +88,13 @@ int testSystemInformation(int, char*[])
printMethod3(info, GetHostMemoryUsed(), "KiB"); printMethod3(info, GetHostMemoryUsed(), "KiB");
printMethod3(info, GetProcMemoryUsed(), "KiB"); printMethod3(info, GetProcMemoryUsed(), "KiB");
for (int i = 0; i <= 31; i++)
{
if (info.DoesCPUSupportFeature(1 << i))
{
kwsys_ios::cout << "CPU feature " << i << "\n";
}
}
//int GetProcessorCacheXSize(long int); //int GetProcessorCacheXSize(long int);
// bool DoesCPUSupportFeature(long int); // bool DoesCPUSupportFeature(long int);
return 0; return 0;