aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Wouter van Kesteren <woutershep@gmail.com> 2013-04-18 16:54:39 +0200
committerAvatar Wouter van Kesteren <woutershep@gmail.com> 2013-04-28 00:19:21 +0200
commit149850cb8bc0d261dd9f93161e5bf1f132fe6ed2 (patch)
tree1c67b193c15a090942d6ecf58eaa18b6d0bf24e4
parenteb5bcb8eaf1a971491541ed646db224c3136063b (diff)
downloadpaludis-149850cb8bc0d261dd9f93161e5bf1f132fe6ed2.tar.gz
paludis-149850cb8bc0d261dd9f93161e5bf1f132fe6ed2.tar.xz
Mark ~RunningProcessHandle() as noexcept(false)
-rw-r--r--configure.ac14
-rw-r--r--paludis/util/attributes.hh6
-rw-r--r--paludis/util/process.cc2
-rw-r--r--paludis/util/process.hh2
4 files changed, 22 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index cc5eeb4..e405672 100644
--- a/configure.ac
+++ b/configure.ac
@@ -896,6 +896,20 @@ enum class C : long { c };
])
dnl }}}
+dnl {{{ c++0x noexcept
+AC_MSG_CHECKING([for c++0x noexcept])
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([
+struct C { ~C() noexcept(false); };
+C::~C() noexcept(false) {}
+])],
+ [AC_MSG_RESULT([yes])
+ PALUDIS_CXXFLAGS="${PALUDIS_CXXFLAGS} -DPALUDIS_HAVE_NOEXCEPT=1"
+ PALUDIS_PC_CFLAGS="${PALUDIS_PC_CFLAGS} -DPALUDIS_HAVE_NOEXCEPT=1"
+ ],
+ [AC_MSG_RESULT([no])
+ ])
+dnl }}}
+
CXXFLAGS="$save_CXXFLAGS"
AC_MSG_CHECKING([whether to enable visibility])
diff --git a/paludis/util/attributes.hh b/paludis/util/attributes.hh
index fa0f030..4fe4cef 100644
--- a/paludis/util/attributes.hh
+++ b/paludis/util/attributes.hh
@@ -72,6 +72,12 @@
# define PALUDIS_HIDDEN
#endif
+#if defined(PALUDIS_HAVE_NOEXCEPT)
+# define PALUDIS_NOEXCEPT(x) noexcept(x)
+#else
+# define PALUDIS_NOEXCEPT(x)
+#endif
+
#define PALUDIS_TLS static __thread
#endif
diff --git a/paludis/util/process.cc b/paludis/util/process.cc
index bf256fe..ff0cf5a 100644
--- a/paludis/util/process.cc
+++ b/paludis/util/process.cc
@@ -1012,7 +1012,7 @@ RunningProcessHandle::RunningProcessHandle(pid_t p, std::unique_ptr<RunningProce
{
}
-RunningProcessHandle::~RunningProcessHandle()
+RunningProcessHandle::~RunningProcessHandle() PALUDIS_NOEXCEPT(false)
{
if (-1 != _imp->pid)
{
diff --git a/paludis/util/process.hh b/paludis/util/process.hh
index 40f1fb0..5cebe8c 100644
--- a/paludis/util/process.hh
+++ b/paludis/util/process.hh
@@ -125,7 +125,7 @@ namespace paludis
const pid_t,
std::unique_ptr<RunningProcessThread> &&);
- ~RunningProcessHandle();
+ ~RunningProcessHandle() PALUDIS_NOEXCEPT(false);
RunningProcessHandle(RunningProcessHandle &&);
RunningProcessHandle(const RunningProcessHandle &) = delete;