This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=89af164cc0cc11ba42ad184263fae1ab98524922

commit 89af164cc0cc11ba42ad184263fae1ab98524922
Author: Guillem Jover <[email protected]>
AuthorDate: Thu Nov 24 03:21:38 2022 +0100

    libdpkg: Split DPKG_ATTR_ declarations
    
    We might want to make these conditional on other criteria, so defining
    them all based on the same version is too restrictive.
---
 lib/dpkg/macros.h | 36 ++++++++++++++++++++++++++++++------
 1 file changed, 30 insertions(+), 6 deletions(-)

diff --git a/lib/dpkg/macros.h b/lib/dpkg/macros.h
index a4776570a..bf48c15c5 100644
--- a/lib/dpkg/macros.h
+++ b/lib/dpkg/macros.h
@@ -41,27 +41,51 @@
 
 #if DPKG_GCC_VERSION >= 0x0300
 #define DPKG_ATTR_UNUSED       __attribute__((unused))
+#else
+#define DPKG_ATTR_UNUSED
+#endif
+
+#if DPKG_GCC_VERSION >= 0x0300
 #define DPKG_ATTR_CONST                __attribute__((const))
+#else
+#define DPKG_ATTR_CONST
+#endif
+
+#if DPKG_GCC_VERSION >= 0x0300
 #define DPKG_ATTR_PURE         __attribute__((pure))
+#else
+#define DPKG_ATTR_PURE
+#endif
+
+#if DPKG_GCC_VERSION >= 0x0300
 #define DPKG_ATTR_MALLOC       __attribute__((malloc))
+#else
+#define DPKG_ATTR_MALLOC
+#endif
+
+#if DPKG_GCC_VERSION >= 0x0300
 #define DPKG_ATTR_NORET                __attribute__((noreturn))
+#else
+#define DPKG_ATTR_NORET
+#endif
+
+#if DPKG_GCC_VERSION >= 0x0300
 #define DPKG_ATTR_PRINTF(n)    __attribute__((format(printf, n, n + 1)))
 #define DPKG_ATTR_VPRINTF(n)   __attribute__((format(printf, n, 0)))
 #else
-#define DPKG_ATTR_UNUSED
-#define DPKG_ATTR_CONST
-#define DPKG_ATTR_PURE
-#define DPKG_ATTR_MALLOC
-#define DPKG_ATTR_NORET
 #define DPKG_ATTR_PRINTF(n)
 #define DPKG_ATTR_VPRINTF(n)
 #endif
 
 #if DPKG_GCC_VERSION > 0x0302
 #define DPKG_ATTR_NONNULL(...) __attribute__((nonnull(__VA_ARGS__)))
-#define DPKG_ATTR_REQRET       __attribute__((warn_unused_result))
 #else
 #define DPKG_ATTR_NONNULL(...)
+#endif
+
+#if DPKG_GCC_VERSION > 0x0302
+#define DPKG_ATTR_REQRET       __attribute__((warn_unused_result))
+#else
 #define DPKG_ATTR_REQRET
 #endif
 

-- 
Dpkg.Org's dpkg

Reply via email to