KWSys 2013-01-07 (fc60c8b8)
Extract upstream KWSys using the following shell commands. $ git archive --prefix=upstream-kwsys/ fc60c8b8 | tar x $ git shortlog --no-merges --abbrev=8 --format='%h %s' 8ce09af5..fc60c8b8 Brad King (3): cb5f835f SystemTools: Fix MakeDirectory with colon in path 1643507a IOStream: Fix check for compiler 'long long' support 34177aec SystemTools: Fix MakeDirectory after recent cleanup Rolf Eike Beer (24): 4da9894d SystemInformation: Clean up QuerySolarisInfo() 01392358 SystemInformation: don't attribute i386 Solaris systems to Sun 3db65ac1 SystemInformation: wrap the call to CPUID in a function 61bd9b42 SystemInformation: use the __cpuid compiler intrinsic if present 5932e7c0 SystemInformation: query memory size on Cygwin using sysconf() ea5612ed SystemInformation: count memory with _SC_PAGESIZE and _SC_PHYS_PAGES 3aca6642 SystemInformation: query memory size, CPU count, and CPU speed on BSD 3572c54d SystemInformation: count CPUs on HP-UX e6771b34 SystemInformation: determine CPU type on HP-UX 640210e5 SystemInformation: use /proc/cpuinfo only when present 5bdcfd10 SystemInformation: query total memory on AIX de69d547 SystemInformation: use intrinsic for RDTSC if supported 9808d4e7 SystemInformation: get CPU speed on Windows when RDTSC fails f4c625b5 tests: avoid truncation of testSystemInformation output in CDash 03d6fbe5 SystemInformation: get x86 CPU features from /proc/cpuinfo f8e917c1 SystemInformation: remove the #define CPUID_INSTRUCTION 59c4b5c5 SystemInformation: split Windows code out of QueryMemory() 200ee91f SystemInformation: split HP-UX code out of QueryMemory() 88217703 SystemInformation: split Linux code out of QueryMemory() 9e317872 SystemInformation: split AIX code out of QueryMemory() 349cee5b SystemInformation: remove useless zeroing from QueryMemory() 7271926e SystemInformation: split Cygwin code out of QueryMemory() 6da78ad1 SystemInformation: make QueryMemory() return bool 182179e9 Haiku no longer defines __BEOS__ Stephen Kelly (1): 247b8a3c SystemTools: Rename MakeCnidentifier() to MakeCidentifier() Change-Id: Ib95b5bddab7ecc0a4025ab29792426acf57e5623
This commit is contained in:
parent
567e7d9467
commit
495fa24d70
|
@ -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()
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
@ -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;
|
||||||
{
|
|
||||||
topdir = dir.substr(0, dir.size());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
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)
|
||||||
|
|
|
@ -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.
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue