[Cmake-commits] CMake branch, next, updated. v2.8.10-768-g88d2bbe
Brad King
brad.king at kitware.com
Tue Nov 6 09:34:37 EST 2012
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 88d2bbebec2092ad9eae22f1c52a722306fc6020 (commit)
via 68579cd6d99063483af66b921a68ba9304d055cf (commit)
via cd83da97a7fdea239033dbe55a1da5ae0a3ae13c (commit)
from 4e2d0a8a0628eb7033aa58a5c0c99a91007b1cb4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=88d2bbebec2092ad9eae22f1c52a722306fc6020
commit 88d2bbebec2092ad9eae22f1c52a722306fc6020
Merge: 4e2d0a8 68579cd
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Nov 6 09:34:21 2012 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Nov 6 09:34:21 2012 -0500
Merge topic 'import-KWSys-subtree' into next
68579cd Merge branch 'upstream-kwsys' into import-KWSys-subtree
cd83da9 KWSys 2012-11-05 (df32fa6f)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=68579cd6d99063483af66b921a68ba9304d055cf
commit 68579cd6d99063483af66b921a68ba9304d055cf
Merge: 3517106 cd83da9
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Nov 6 09:28:58 2012 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Nov 6 09:28:58 2012 -0500
Merge branch 'upstream-kwsys' into import-KWSys-subtree
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cd83da97a7fdea239033dbe55a1da5ae0a3ae13c
commit cd83da97a7fdea239033dbe55a1da5ae0a3ae13c
Author: KWSys Robot <kwrobot at kitware.com>
AuthorDate: Mon Nov 5 12:00:08 2012 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Nov 6 09:28:52 2012 -0500
KWSys 2012-11-05 (df32fa6f)
Extract upstream KWSys using the following shell commands.
$ git archive --prefix=upstream-kwsys/ df32fa6f | tar x
$ git shortlog --no-merges --abbrev=8 --format='%h %s' b7a97ac3..df32fa6f
Brad King (4):
b90f28e3 SystemInformation: Use kwsys_ios:: for string streams
b7c42507 SystemInformation: No backtrace on LSB < 4.1
2c46f562 SystemInformation: Fix sw_vers output processing
df32fa6f SystemInformation: Compute FQDN only on specific platforms
Change-Id: I0a8f2d7c56a6dbde70e1dfbc1e25712b2f9b0e48
diff --git a/SystemInformation.cxx b/SystemInformation.cxx
index cbd1bdc..6b63b94 100644
--- a/SystemInformation.cxx
+++ b/SystemInformation.cxx
@@ -74,6 +74,18 @@ typedef int siginfo_t;
# include <errno.h> // extern int errno;
#endif
+#ifdef __FreeBSD__
+# include <sys/sysctl.h>
+# include <fenv.h>
+# include <sys/socket.h>
+# include <netdb.h>
+# include <netinet/in.h>
+# if defined(KWSYS_SYS_HAS_IFADDRS_H)
+# include <ifaddrs.h>
+# define KWSYS_SYSTEMINFORMATION_IMPLEMENT_FQDN
+# endif
+#endif
+
#ifdef __APPLE__
# include <sys/sysctl.h>
# include <mach/vm_statistics.h>
@@ -84,6 +96,10 @@ typedef int siginfo_t;
# include <sys/socket.h>
# include <netdb.h>
# include <netinet/in.h>
+# if defined(KWSYS_SYS_HAS_IFADDRS_H)
+# include <ifaddrs.h>
+# define KWSYS_SYSTEMINFORMATION_IMPLEMENT_FQDN
+# endif
# if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 >= 1050
# include <execinfo.h>
# define KWSYS_SYSTEMINFORMATION_HAVE_BACKTRACE
@@ -95,9 +111,17 @@ typedef int siginfo_t;
# include <sys/socket.h>
# include <netdb.h>
# include <netinet/in.h>
+# if defined(KWSYS_SYS_HAS_IFADDRS_H)
+# include <ifaddrs.h>
+# if !defined(__LSB_VERSION__) /* LSB has no getifaddrs */
+# define KWSYS_SYSTEMINFORMATION_IMPLEMENT_FQDN
+# endif
+# endif
# if defined(__GNUG__)
# include <execinfo.h>
-# define KWSYS_SYSTEMINFORMATION_HAVE_BACKTRACE
+# if !(defined(__LSB_VERSION__) && __LSB_VERSION__ < 41)
+# define KWSYS_SYSTEMINFORMATION_HAVE_BACKTRACE
+# endif
# endif
# if defined(KWSYS_CXX_HAS_RLIMIT64)
typedef struct rlimit64 ResourceLimitType;
@@ -111,10 +135,6 @@ typedef struct rlimit ResourceLimitType;
# include <sys/pstat.h>
#endif
-#if defined(KWSYS_SYS_HAS_IFADDRS_H)
-# include <ifaddrs.h>
-#endif
-
#ifdef __HAIKU__
# include <OS.h>
#endif
@@ -453,7 +473,7 @@ bool SystemInformation::DoesCPUSupportFeature(long int i)
kwsys_stl::string SystemInformation::GetCPUDescription()
{
- kwsys_stl::ostringstream oss;
+ kwsys_ios::ostringstream oss;
oss
<< this->GetNumberOfPhysicalCPU()
<< " core ";
@@ -543,7 +563,7 @@ int SystemInformation::GetOSIsApple()
kwsys_stl::string SystemInformation::GetOSDescription()
{
- kwsys_stl::ostringstream oss;
+ kwsys_ios::ostringstream oss;
oss
<< this->GetOSName()
<< " "
@@ -599,7 +619,7 @@ kwsys_stl::string SystemInformation::GetMemoryDescription(
const char *hostLimitEnvVarName,
const char *procLimitEnvVarName)
{
- kwsys_stl::ostringstream oss;
+ kwsys_ios::ostringstream oss;
oss
<< "Host Total: "
<< iostreamLongLong(this->GetHostMemoryTotal())
@@ -805,7 +825,7 @@ int NameValue(
{
continue;
}
- kwsys_stl::istringstream is(lines[i].substr(at+name.size()));
+ kwsys_ios::istringstream is(lines[i].substr(at+name.size()));
is >> value;
return 0;
}
@@ -1271,7 +1291,7 @@ int SystemInformationImplementation::GetFullyQualifiedDomainName(
WSACleanup();
return 0;
-#elif defined(KWSYS_SYS_HAS_IFADDRS_H)
+#elif defined(KWSYS_SYSTEMINFORMATION_IMPLEMENT_FQDN)
// gethostname typical returns an alias for loopback interface
// we want the fully qualified domain name. Because there are
// any number of interfaces on this system we look for the
@@ -3310,7 +3330,7 @@ SystemInformationImplementation::GetProcMemoryUsed()
#elif defined(__APPLE__)
SystemInformation::LongLong memUsed=0;
pid_t pid=getpid();
- kwsys_stl::ostringstream oss;
+ kwsys_ios::ostringstream oss;
oss << "ps -o rss= -p " << pid;
FILE *file=popen(oss.str().c_str(),"r");
if (file==0)
@@ -3335,7 +3355,7 @@ SystemInformationImplementation::GetProcMemoryUsed()
{
return -2;
}
- kwsys_stl::istringstream iss(oss.str());
+ kwsys_ios::istringstream iss(oss.str());
iss >> memUsed;
return memUsed;
#else
@@ -4670,22 +4690,12 @@ int SystemInformationImplementation::CallSwVers(
kwsys_stl::string &ver)
{
#ifdef __APPLE__
- kwsys_stl::ostringstream oss;
- oss << "sw_vers " << arg;
- FILE *f=popen(oss.str().c_str(),"r");
- if (f==0)
- {
- return -1;
- }
- oss.str("");
- char buf[256]={'\0'};
- while (fgets(buf, 256, f) != 0)
- {
- oss << buf;
- }
- pclose(f);
- kwsys_stl::istringstream iss(oss.str());
- iss >> ver;
+ kwsys_stl::vector<const char*> args;
+ args.push_back("sw_vers");
+ args.push_back(arg);
+ args.push_back(0);
+ ver = this->RunProcess(args);
+ this->TrimNewline(ver);
#else
// avoid C4100
(void)arg;
-----------------------------------------------------------------------
Summary of changes:
Source/kwsys/SystemInformation.cxx | 66 ++++++++++++++++++++---------------
1 files changed, 38 insertions(+), 28 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list