diff options
author | Jose <jose@zeroc.com> | 2019-02-07 18:43:12 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2019-02-07 21:02:19 +0100 |
commit | 065e5f80067bf8ab72077039d5414d9383565a01 (patch) | |
tree | 1c6f0217cf1a9ea62ec8e31a51317de8e6bfc642 /cpp/src | |
parent | Amazon Linux is now amzn2 (diff) | |
download | ice-065e5f80067bf8ab72077039d5414d9383565a01.tar.bz2 ice-065e5f80067bf8ab72077039d5414d9383565a01.tar.xz ice-065e5f80067bf8ab72077039d5414d9383565a01.zip |
Fix macros for Linux OS detection
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/Instance.cpp | 2 | ||||
-rwxr-xr-x | cpp/src/Ice/Network.cpp | 10 | ||||
-rw-r--r-- | cpp/src/IceGrid/Activator.cpp | 4 | ||||
-rw-r--r-- | cpp/src/IceGrid/PlatformInfo.cpp | 4 | ||||
-rw-r--r-- | cpp/src/IceSSL/OpenSSLEngine.cpp | 2 |
5 files changed, 11 insertions, 11 deletions
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp index 4c3fa1f1e5c..8d448ee0ddb 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 9a865c664c7..19aac9ec2c4 100755 --- 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> @@ -346,7 +346,7 @@ getLocalAddresses(ProtocolSupport protocol, bool includeLoopback, bool singleAdd 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) { @@ -648,7 +648,7 @@ getInterfaceIndex(const string& intf) // if(isAddr) { -# if defined(__linux) || defined(__APPLE__) || defined(__FreeBSD__) +# if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) struct ifaddrs* ifap; if(::getifaddrs(&ifap) != SOCKET_ERROR) { @@ -2653,7 +2653,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 @@ -2722,7 +2722,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 052939a377b..7982685b1f1 100644 --- a/cpp/src/IceGrid/Activator.cpp +++ b/cpp/src/IceGrid/Activator.cpp @@ -32,7 +32,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 @@ -1413,7 +1413,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 dc90ad2b278..9b265a80eda 100644 --- a/cpp/src/IceGrid/PlatformInfo.cpp +++ b/cpp/src/IceGrid/PlatformInfo.cpp @@ -333,7 +333,7 @@ PlatformInfo::PlatformInfo(const string& prefix, { #if defined(_WIN32) _nProcessorSockets = getSocketCount(_traceLevels->logger); -#elif defined(__linux) +#elif defined(__linux__) ifstream is("/proc/cpuinfo"); set<string> ids; @@ -484,7 +484,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 1cf3fa1c96b..6e5252209eb 100644 --- a/cpp/src/IceSSL/OpenSSLEngine.cpp +++ b/cpp/src/IceSSL/OpenSSLEngine.cpp @@ -84,7 +84,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. // |