Merge branch 'upstream-kwsys' into update-kwsys

This commit is contained in:
Brad King 2014-12-17 15:00:39 -05:00
commit 3470704f5a
4 changed files with 58 additions and 15 deletions

View File

@ -0,0 +1,35 @@
Contributing to KWSys
*********************
Overview
========
KWSys is kept in its own Git repository and shared by several projects
via copies in their source trees. Changes to KWSys should not be made
directly in a host project, except perhaps in maintenance branches.
Please visit
http://public.kitware.com/Wiki/KWSys/Git
to contribute changes directly to KWSys upstream. Once changes are
reviewed, tested, and integrated there then the copies of KWSys within
dependent projects can be updated to get the changes.
Issues
======
KWSys has no independent issue tracker. After encountering an issue
(bug) please try to submit a patch using the above instructions.
Otherwise please report the issue to the tracker for the project that
hosts the copy of KWSys in which the problem was found.
License
=======
We do not require any formal copyright assignment or contributor license
agreement. Any contributions intentionally sent upstream are presumed
to be offerred under terms of the OSI-approved BSD 3-clause License.
See `Copyright.txt`_ for details.
.. _`Copyright.txt`: Copyright.txt

View File

@ -203,13 +203,18 @@ unsigned long Directory::GetNumberOfFilesInDirectory(const kwsys_stl::string& na
#include <sys/types.h> #include <sys/types.h>
#include <dirent.h> #include <dirent.h>
/* There is a problem with the Portland compiler, large file // PGI with glibc has trouble with dirent and large file support:
support and glibc/Linux system headers: // http://www.pgroup.com/userforum/viewtopic.php?
http://www.pgroup.com/userforum/viewtopic.php? // p=1992&sid=f16167f51964f1a68fe5041b8eb213b6
p=1992&sid=f16167f51964f1a68fe5041b8eb213b6 // Work around the problem by mapping dirent the same way as readdir.
*/ #if defined(__PGI) && defined(__GLIBC__)
#if defined(__PGI) && defined(__USE_FILE_OFFSET64) # define kwsys_dirent_readdir dirent
# define dirent dirent64 # define kwsys_dirent_readdir64 dirent64
# define kwsys_dirent kwsys_dirent_lookup(readdir)
# define kwsys_dirent_lookup(x) kwsys_dirent_lookup_delay(x)
# define kwsys_dirent_lookup_delay(x) kwsys_dirent_##x
#else
# define kwsys_dirent dirent
#endif #endif
namespace KWSYS_NAMESPACE namespace KWSYS_NAMESPACE
@ -226,7 +231,7 @@ bool Directory::Load(const kwsys_stl::string& name)
return 0; return 0;
} }
for (dirent* d = readdir(dir); d; d = readdir(dir) ) for (kwsys_dirent* d = readdir(dir); d; d = readdir(dir) )
{ {
this->Internal->Files.push_back(d->d_name); this->Internal->Files.push_back(d->d_name);
} }
@ -240,7 +245,7 @@ unsigned long Directory::GetNumberOfFilesInDirectory(const kwsys_stl::string& na
DIR* dir = opendir(name.c_str()); DIR* dir = opendir(name.c_str());
unsigned long count = 0; unsigned long count = 0;
for (dirent* d = readdir(dir); d; d = readdir(dir) ) for (kwsys_dirent* d = readdir(dir); d; d = readdir(dir) )
{ {
count++; count++;
} }

View File

@ -8,3 +8,5 @@ details.
You are probably reading this file in the source tree of a surrounding You are probably reading this file in the source tree of a surrounding
project. In that case, see "../README.kwsys" for details of using project. In that case, see "../README.kwsys" for details of using
KWSys in your project. KWSys in your project.
See CONTRIBUTING.rst for instructions to contribute KWSys changes.

View File

@ -443,7 +443,7 @@ public:
}; };
protected: protected:
// Functions. // For windows
bool RetrieveCPUFeatures(); bool RetrieveCPUFeatures();
bool RetrieveCPUIdentity(); bool RetrieveCPUIdentity();
bool RetrieveCPUCacheDetails(); bool RetrieveCPUCacheDetails();
@ -457,6 +457,7 @@ protected:
bool RetrieveClassicalCPUIdentity(); bool RetrieveClassicalCPUIdentity();
bool RetrieveExtendedCPUIdentity(); bool RetrieveExtendedCPUIdentity();
// Processor information
Manufacturer ChipManufacturer; Manufacturer ChipManufacturer;
CPUFeatures Features; CPUFeatures Features;
ID ChipID; ID ChipID;
@ -464,11 +465,11 @@ protected:
unsigned int NumberOfLogicalCPU; unsigned int NumberOfLogicalCPU;
unsigned int NumberOfPhysicalCPU; unsigned int NumberOfPhysicalCPU;
int CPUCount(); int CPUCount(); // For windows
unsigned char LogicalCPUPerPhysicalCPU(); unsigned char LogicalCPUPerPhysicalCPU();
unsigned char GetAPICId(); unsigned char GetAPICId(); // For windows
bool IsHyperThreadingSupported(); bool IsHyperThreadingSupported();
static LongLong GetCyclesDifference(DELAY_FUNC, unsigned int); static LongLong GetCyclesDifference(DELAY_FUNC, unsigned int); // For windows
// For Linux and Cygwin, /proc/cpuinfo formats are slightly different // For Linux and Cygwin, /proc/cpuinfo formats are slightly different
bool RetreiveInformationFromCpuInfoFile(); bool RetreiveInformationFromCpuInfoFile();
@ -3753,9 +3754,9 @@ bool SystemInformationImplementation::QueryWindowsMemory()
} }
# define MEM_VAL(value) ull##value # define MEM_VAL(value) ull##value
# endif # endif
tv = ms.MEM_VAL(TotalVirtual); tv = ms.MEM_VAL(TotalPageFile);
tp = ms.MEM_VAL(TotalPhys); tp = ms.MEM_VAL(TotalPhys);
av = ms.MEM_VAL(AvailVirtual); av = ms.MEM_VAL(AvailPageFile);
ap = ms.MEM_VAL(AvailPhys); ap = ms.MEM_VAL(AvailPhys);
this->TotalVirtualMemory = tv>>10>>10; this->TotalVirtualMemory = tv>>10>>10;
this->TotalPhysicalMemory = tp>>10>>10; this->TotalPhysicalMemory = tp>>10>>10;