diff options
author | Jose <jose@zeroc.com> | 2019-02-07 18:43:12 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2019-07-19 16:46:34 +0200 |
commit | 11c8edf0f40ce9ca364744c44c6b4fde2ec2854e (patch) | |
tree | c2f0c66c23f336042073f222ed1d5bac20ee74fd | |
parent | Disable JavaFx builds when building with JDK > 8 (diff) | |
download | ice-11c8edf0f40ce9ca364744c44c6b4fde2ec2854e.tar.bz2 ice-11c8edf0f40ce9ca364744c44c6b4fde2ec2854e.tar.xz ice-11c8edf0f40ce9ca364744c44c6b4fde2ec2854e.zip |
Fix macros for Linux OS detection
-rw-r--r-- | cpp/src/Ice/Instance.cpp | 2 | ||||
-rw-r--r-- | cpp/src/Ice/Network.cpp | 10 | ||||
-rw-r--r-- | cpp/src/IceGrid/Activator.cpp | 4 | ||||
-rw-r--r-- | cpp/src/IceGrid/PlatformInfo.cpp | 6 | ||||
-rw-r--r-- | cpp/src/IceSSL/OpenSSLEngine.cpp | 2 |
5 files changed, 12 insertions, 12 deletions
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp index b9d3ca326b5..e7b68f14b5b 100644 --- a/cpp/src/Ice/Instance.cpp +++ b/cpp/src/Ice/Instance.cpp @@ -61,7 +61,7 @@ # include <sys/types.h> #endif -#if defined(__linux) || defined(__sun) || defined(_AIX) || defined(__GLIBC__) +#if defined(__linux__) || defined(__sun) || defined(_AIX) || defined(__GLIBC__) # include <grp.h> // for initgroups #endif diff --git a/cpp/src/Ice/Network.cpp b/cpp/src/Ice/Network.cpp index 3210f30c691..aba3499bd47 100644 --- a/cpp/src/Ice/Network.cpp +++ b/cpp/src/Ice/Network.cpp @@ -46,7 +46,7 @@ # include <sys/ioctl.h> #endif -#if defined(__linux) || defined(__APPLE__) || defined(__FreeBSD__) +#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) # include <ifaddrs.h> #elif defined(__sun) # include <sys/sockio.h> @@ -279,7 +279,7 @@ getLocalAddresses(ProtocolSupport protocol, bool includeLoopback) free(adapter_addresses); } -#elif defined(__linux) || defined(__APPLE__) || defined(__FreeBSD__) +#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) struct ifaddrs* ifap; if(::getifaddrs(&ifap) == SOCKET_ERROR) { @@ -563,7 +563,7 @@ getInterfaceIndex(const string& name) // if(isAddr) { -# if defined(__linux) || defined(__APPLE__) || defined(__FreeBSD__) +# if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) struct ifaddrs* ifap; if(::getifaddrs(&ifap) != SOCKET_ERROR) { @@ -2293,7 +2293,7 @@ repeatConnect: } } -#if defined(__linux) +#if defined(__linux__) // // Prevent self connect (self connect happens on Linux when a client tries to connect to // a server which was just deactivated if the client socket re-uses the same ephemeral @@ -2372,7 +2372,7 @@ IceInternal::doFinishConnect(SOCKET fd) } } -#if defined(__linux) +#if defined(__linux__) // // Prevent self connect (self connect happens on Linux when a client tries to connect to // a server which was just deactivated if the client socket re-uses the same ephemeral diff --git a/cpp/src/IceGrid/Activator.cpp b/cpp/src/IceGrid/Activator.cpp index 3b30ec49007..491aaf82727 100644 --- a/cpp/src/IceGrid/Activator.cpp +++ b/cpp/src/IceGrid/Activator.cpp @@ -37,7 +37,7 @@ #endif #endif -#if defined(__linux) || defined(__sun) || defined(_AIX) || defined(__GLIBC__) +#if defined(__linux__) || defined(__sun) || defined(_AIX) || defined(__GLIBC__) # include <grp.h> // for setgroups #endif @@ -1469,7 +1469,7 @@ Activator::waitPid(pid_t processPid) try { int status; -#if defined(__linux) +#if defined(__linux__) int nRetry = 0; while(true) // The while loop is necessary for the linux workaround. { diff --git a/cpp/src/IceGrid/PlatformInfo.cpp b/cpp/src/IceGrid/PlatformInfo.cpp index cc5d8f620e3..b69f2d0e438 100644 --- a/cpp/src/IceGrid/PlatformInfo.cpp +++ b/cpp/src/IceGrid/PlatformInfo.cpp @@ -299,10 +299,10 @@ PlatformInfo::PlatformInfo(const string& prefix, { #if defined(_WIN32) _nProcessorSockets = getSocketCount(_traceLevels->logger); -#elif defined(__linux) +#elif defined(__linux__) IceUtilInternal::ifstream is(string("/proc/cpuinfo")); set<string> ids; - + int nprocessor = 0; while(is) { @@ -450,7 +450,7 @@ PlatformInfo::getLoadInfo() info.avg1 = static_cast<float>(_last1Total) / _usages1.size() / 100.0f; info.avg5 = static_cast<float>(_last5Total) / _usages5.size() / 100.0f; info.avg15 = static_cast<float>(_last15Total) / _usages15.size() / 100.0f; -#elif defined(__sun) || defined(__linux) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) +#elif defined(__sun) || defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) // // We use the load average divided by the number of // processors to figure out if the machine is busy or diff --git a/cpp/src/IceSSL/OpenSSLEngine.cpp b/cpp/src/IceSSL/OpenSSLEngine.cpp index 5c501bf8a49..8143d8c6402 100644 --- a/cpp/src/IceSSL/OpenSSLEngine.cpp +++ b/cpp/src/IceSSL/OpenSSLEngine.cpp @@ -118,7 +118,7 @@ IceSSL_opensslThreadIdCallback() // On some platforms, pthread_t is a pointer to a per-thread structure. // return reinterpret_cast<unsigned long>(pthread_self()); -# elif defined(__linux) || defined(__sun) || defined(__hpux) || defined(_AIX) || defined(__GLIBC__) +# elif defined(__linux__) || defined(__sun) || defined(__hpux) || defined(_AIX) || defined(__GLIBC__) // // On Linux, Solaris, HP-UX and AIX, pthread_t is an integer. // |