Просмотр исходного кода

libdpkg: Add DPKG_ATTR_THROW and DPKG_ATTR_NOEXCEPT macros

Guillem Jover лет назад: 12
Родитель
Сommit
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		}