summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2014-06-09 15:39:37 +0200
committerGuillem Jover <guillem@debian.org>2014-08-09 22:04:12 +0200
commit633159444e2f0c8fe1e167aff56d70601168610a (patch)
tree2fc882f733dbb4ae3b62f4e988e41f4ae5e98409 /lib
parent75a93afbe53d6d2554ed87abeb794a75373156fd (diff)
downloaddpkg-633159444e2f0c8fe1e167aff56d70601168610a.tar.gz
libdpkg: Add DPKG_ATTR_THROW and DPKG_ATTR_NOEXCEPT macros
Diffstat (limited to 'lib')
-rw-r--r--lib/dpkg/macros.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/dpkg/macros.h b/lib/dpkg/macros.h
index 9f033f33b..0c1937a09 100644
--- a/lib/dpkg/macros.h
+++ b/lib/dpkg/macros.h
@@ -71,6 +71,14 @@
#define DPKG_ATTR_SENTINEL
#endif
+#if defined(__cplusplus) && __cplusplus >= 201103L
+#define DPKG_ATTR_THROW(exception)
+#define DPKG_ATTR_NOEXCEPT noexcept
+#elif defined(__cplusplus)
+#define DPKG_ATTR_THROW(exception) throw(exception)
+#define DPKG_ATTR_NOEXCEPT throw()
+#endif
+
#ifdef __cplusplus
#define DPKG_BEGIN_DECLS extern "C" {
#define DPKG_END_DECLS }