[icinga-checkins] icinga.org: icinga2/master: Use #if rather than #ifdef to check HAVE_* macros.

git at icinga.org git at icinga.org
Thu Feb 14 10:56:04 CET 2013


Module: icinga2
Branch: master
Commit: 49576d3a82bc399b1564462fcb006d02b39b3364
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=49576d3a82bc399b1564462fcb006d02b39b3364

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Thu Feb 14 10:55:15 2013 +0100

Use #if rather than #ifdef to check HAVE_* macros.

---

 lib/base/i2-base.h        |    2 +-
 lib/base/process-unix.cpp |   10 +++++-----
 lib/base/utility.cpp      |    6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/lib/base/i2-base.h b/lib/base/i2-base.h
index 66ee13c..e05270c 100644
--- a/lib/base/i2-base.h
+++ b/lib/base/i2-base.h
@@ -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 */
 
diff --git a/lib/base/process-unix.cpp b/lib/base/process-unix.cpp
index dda0f48..f3658f2 100644
--- a/lib/base/process-unix.cpp
+++ b/lib/base/process-unix.cpp
@@ -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));
diff --git a/lib/base/utility.cpp b/lib/base/utility.cpp
index 1cecfc3..380a035 100644
--- a/lib/base/utility.cpp
+++ b/lib/base/utility.cpp
@@ -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]));
 





More information about the icinga-checkins mailing list