From 49576d3a82bc399b1564462fcb006d02b39b3364 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 14 Feb 2013 10:55:15 +0100 Subject: [PATCH] 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 66ee13c82..e05270c01 100644 --- a/lib/base/i2-base.h +++ b/lib/base/i2-base.h @@ -166,7 +166,7 @@ namespace tuples = boost::tuples; #include #include -#ifdef HAVE_GCC_ABI_DEMANGLE +#if HAVE_GCC_ABI_DEMANGLE # include #endif /* HAVE_GCC_ABI_DEMANGLE */ diff --git a/lib/base/process-unix.cpp b/lib/base/process-unix.cpp index dda0f4866..f3658f27f 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 1cecfc3bd..380a035ad 100644 --- a/lib/base/utility.cpp +++ b/lib/base/utility.cpp @@ -19,7 +19,7 @@ #include "i2-base.h" #include -#ifdef HAVE_BACKTRACE_SYMBOLS +#if HAVE_BACKTRACE_SYMBOLS # include #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])); -- 2.40.0