]> granicus.if.org Git - icinga2/commitdiff
Use #if rather than #ifdef to check HAVE_* macros.
authorGunnar Beutner <gunnar.beutner@netways.de>
Thu, 14 Feb 2013 09:55:15 +0000 (10:55 +0100)
committerGunnar Beutner <gunnar.beutner@netways.de>
Thu, 14 Feb 2013 09:55:15 +0000 (10:55 +0100)
lib/base/i2-base.h
lib/base/process-unix.cpp
lib/base/utility.cpp

index 66ee13c82aee4d5e826a0b6ad9c522f03683bd91..e05270c01ad51e20bab128941921f2cf9cf28787 100644 (file)
@@ -166,7 +166,7 @@ namespace tuples = boost::tuples;
 #include <openssl/ssl.h>
 #include <openssl/err.h>
 
-#ifdef HAVE_GCC_ABI_DEMANGLE
+#if HAVE_GCC_ABI_DEMANGLE
 #      include <cxxabi.h>
 #endif /* HAVE_GCC_ABI_DEMANGLE */
 
index dda0f486611bd018622f4fcbac8b6809e979bad3..f3658f27f8192709312ddcb3a1cb3b10a9bc5e1a 100644 (file)
@@ -30,7 +30,7 @@ void Process::CreateWorkers(void)
 {
        int fds[2];
 
-#ifdef HAVE_PIPE2
+#if HAVE_PIPE2
        if (pipe2(fds, O_CLOEXEC) < 0)
                BOOST_THROW_EXCEPTION(PosixException("pipe2() failed.", errno));
 #else /* HAVE_PIPE2 */
@@ -172,7 +172,7 @@ void Process::InitTask(void)
 
        int fds[2];
 
-#ifdef HAVE_PIPE2
+#if HAVE_PIPE2
        if (pipe2(fds, O_NONBLOCK | O_CLOEXEC) < 0)
                BOOST_THROW_EXCEPTION(PosixException("pipe2() failed.", errno));
 #else /* HAVE_PIPE2 */
@@ -223,11 +223,11 @@ void Process::InitTask(void)
 
        m_ExtraEnvironment.reset();
 
-#ifdef HAVE_VFORK
+#if HAVE_WORKING_VFORK
        m_Pid = vfork();
-#else /* HAVE_VFORK */
+#else /* HAVE_WORKING_VFORK */
        m_Pid = fork();
-#endif /* HAVE_VFORK */
+#endif /* HAVE_WORKING_VFORK */
 
        if (m_Pid < 0)
                BOOST_THROW_EXCEPTION(PosixException("fork() failed.", errno));
index 1cecfc3bdd953d736d0acf5bfbc9f03d5544fb32..380a035ad935ab63ad9283fab0148d70e5335b69 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "i2-base.h"
 #include <mmatch.h>
-#ifdef HAVE_BACKTRACE_SYMBOLS
+#if HAVE_BACKTRACE_SYMBOLS
 #      include <execinfo.h>
 #endif /* HAVE_BACKTRACE_SYMBOLS */
 
@@ -37,7 +37,7 @@ String Utility::DemangleSymbolName(const String& sym)
 {
        String result = sym;
 
-#ifdef HAVE_GCC_ABI_DEMANGLE
+#if HAVE_GCC_ABI_DEMANGLE
        int status;
        char *realname = abi::__cxa_demangle(sym.CStr(), 0, 0, &status);
 
@@ -71,7 +71,7 @@ String Utility::GetTypeName(const type_info& ti)
  */
 bool Utility::PrintStacktrace(ostream& fp, int ignoreFrames)
 {
-#ifdef HAVE_BACKTRACE_SYMBOLS
+#if HAVE_BACKTRACE_SYMBOLS
        void *frames[50];
        int framecount = backtrace(frames, sizeof(frames) / sizeof(frames[0]));