瀏覽代碼

libdpkg: Add DPKG_ATTR_THROW and DPKG_ATTR_NOEXCEPT macros

Guillem Jover 12 年之前
父節點
當前提交
633159444e
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      lib/dpkg/macros.h

+ 8 - 0
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		}