[Cmake-commits] CMake branch, next, updated. v2.8.10-683-g72a4b74
Brad King
brad.king at kitware.com
Thu Nov 1 10:29:09 EDT 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 72a4b74c7701d2249412c4057bf285bc7932eb3a (commit)
via 7bc06080fff9e151a0bc09ac59ea5a5f7a4bb2f1 (commit)
via facd09c4eff75ddd00b4dc3864245c082115227a (commit)
from 27981b714bd667de0060a6c85e40077b123edace (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=72a4b74c7701d2249412c4057bf285bc7932eb3a
commit 72a4b74c7701d2249412c4057bf285bc7932eb3a
Merge: 27981b7 7bc0608
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Nov 1 10:29:05 2012 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Nov 1 10:29:05 2012 -0400
Merge topic 'fix-KWSys-SystemInformation' into next
7bc0608 KWSys: In SystemInformation use netdb.h only where available
facd09c KWSys: In SystemInformation use kwsys_ios:: for string streams
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7bc06080fff9e151a0bc09ac59ea5a5f7a4bb2f1
commit 7bc06080fff9e151a0bc09ac59ea5a5f7a4bb2f1
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Nov 1 10:25:24 2012 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Thu Nov 1 10:27:17 2012 -0400
KWSys: In SystemInformation use netdb.h only where available
Use getnameinfo and NI_MAXHOST only when their header is available.
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
index 777d76f..bc133fd 100644
--- a/Source/kwsys/CMakeLists.txt
+++ b/Source/kwsys/CMakeLists.txt
@@ -582,6 +582,11 @@ IF(KWSYS_USE_SystemInformation)
SET_PROPERTY(SOURCE SystemInformation.cxx APPEND PROPERTY
COMPILE_DEFINITIONS KWSYS_SYS_HAS_IFADDRS_H=1)
ENDIF()
+ CHECK_INCLUDE_FILES("sys/types.h;netdb.h" KWSYS_SYS_HAS_NETDB_H)
+ IF(KWSYS_SYS_HAS_NETDB_H)
+ SET_PROPERTY(SOURCE SystemInformation.cxx APPEND PROPERTY
+ COMPILE_DEFINITIONS KWSYS_SYS_HAS_NETDB_H=1)
+ ENDIF()
ENDIF()
IF(WIN32)
INCLUDE(CheckSymbolExists)
diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx
index 8d2d191..00e15f5 100644
--- a/Source/kwsys/SystemInformation.cxx
+++ b/Source/kwsys/SystemInformation.cxx
@@ -82,7 +82,6 @@ typedef int siginfo_t;
# include <mach/mach_types.h>
# include <fenv.h>
# include <sys/socket.h>
-# include <netdb.h>
# include <netinet/in.h>
# if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 >= 1050
# include <execinfo.h>
@@ -93,7 +92,6 @@ typedef int siginfo_t;
#ifdef __linux
# include <fenv.h>
# include <sys/socket.h>
-# include <netdb.h>
# include <netinet/in.h>
# if defined(__GNUG__)
# include <execinfo.h>
@@ -114,6 +112,9 @@ typedef struct rlimit ResourceLimitType;
#if defined(KWSYS_SYS_HAS_IFADDRS_H)
# include <ifaddrs.h>
#endif
+#if defined(KWSYS_SYS_HAS_NETDB_H)
+# include <netdb.h>
+#endif
#ifdef __HAIKU__
# include <OS.h>
@@ -1271,7 +1272,7 @@ int SystemInformationImplementation::GetFullyQualifiedDomainName(
WSACleanup();
return 0;
-#elif defined(KWSYS_SYS_HAS_IFADDRS_H)
+#elif defined(KWSYS_SYS_HAS_IFADDRS_H) && defined(KWSYS_SYS_HAS_NETDB_H)
// 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
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=facd09c4eff75ddd00b4dc3864245c082115227a
commit facd09c4eff75ddd00b4dc3864245c082115227a
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Nov 1 10:10:13 2012 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Thu Nov 1 10:12:15 2012 -0400
KWSys: In SystemInformation use kwsys_ios:: for string streams
Replace accidental use of kwsys_stl:: with kwsys_ios:: to reference
string streams. The former is the namespace for STL, the latter for
streams.
diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx
index cbd1bdc..8d2d191 100644
--- a/Source/kwsys/SystemInformation.cxx
+++ b/Source/kwsys/SystemInformation.cxx
@@ -453,7 +453,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 +543,7 @@ int SystemInformation::GetOSIsApple()
kwsys_stl::string SystemInformation::GetOSDescription()
{
- kwsys_stl::ostringstream oss;
+ kwsys_ios::ostringstream oss;
oss
<< this->GetOSName()
<< " "
@@ -599,7 +599,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 +805,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;
}
@@ -3310,7 +3310,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 +3335,7 @@ SystemInformationImplementation::GetProcMemoryUsed()
{
return -2;
}
- kwsys_stl::istringstream iss(oss.str());
+ kwsys_ios::istringstream iss(oss.str());
iss >> memUsed;
return memUsed;
#else
@@ -4670,7 +4670,7 @@ int SystemInformationImplementation::CallSwVers(
kwsys_stl::string &ver)
{
#ifdef __APPLE__
- kwsys_stl::ostringstream oss;
+ kwsys_ios::ostringstream oss;
oss << "sw_vers " << arg;
FILE *f=popen(oss.str().c_str(),"r");
if (f==0)
@@ -4684,7 +4684,7 @@ int SystemInformationImplementation::CallSwVers(
oss << buf;
}
pclose(f);
- kwsys_stl::istringstream iss(oss.str());
+ kwsys_ios::istringstream iss(oss.str());
iss >> ver;
#else
// avoid C4100
-----------------------------------------------------------------------
Summary of changes:
Source/kwsys/CMakeLists.txt | 5 +++++
Source/kwsys/SystemInformation.cxx | 23 ++++++++++++-----------
2 files changed, 17 insertions(+), 11 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list