]> git.ipfire.org Git - thirdparty/ulogd2.git/commitdiff
output: IPFIX: remove compiler attribute macros
authorJeremy Sowden <jeremy@azazel.net>
Tue, 30 Nov 2021 10:56:00 +0000 (10:56 +0000)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 3 Jan 2022 17:59:51 +0000 (18:59 +0100)
The ipfix.h header includes three macros which expand to compiler attributes.
Presumably, at some point the definitions were one branch of an if-else
preprocessor conditional where the definitions in the other branch expanded to
nothing.  This is no longer the case.  Only one of the macros (`__packed`) is
used and the raw attribute is used elsewhere in the code-base.  Remove the
macros.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/ulogd/ulogd.h
output/ipfix/ipfix.c
output/ipfix/ipfix.h

index a487c8e70e37cddb56af43374bf3a79477bdba3c..092d9f521a70fea71710adad1792dc93caa4754c 100644 (file)
 
 /* types without length */
 #define ULOGD_RET_NONE         0x0000
-#define __packed               __attribute__((packed))
-#define __noreturn             __attribute__((noreturn))
-#define __cold                 __attribute__((cold))
-
-#define __packed               __attribute__((packed))
 
 #define ULOGD_RET_INT8         0x0001
 #define ULOGD_RET_INT16                0x0002
index b2719fd1d8a376f60abcd9638c599e710c7ef35a..e0b3440e1d1a282daea19124b902066c2e5956cf 100644 (file)
@@ -8,8 +8,6 @@
 /* These forward declarations are needed since ulogd.h doesn't like to be the first */
 #include <ulogd/linuxlist.h>
 
-#define __packed               __attribute__((packed))
-
 #include "ipfix.h"
 
 #include <ulogd/ulogd.h>
index 93945fbd562bead3167d0b7629696dc7ffb0e065..b0f3ae64740f606600bb7461ea5a002887f43e6d 100644 (file)
@@ -19,7 +19,7 @@ struct ipfix_hdr {
        uint32_t seqno;
        uint32_t oid;                           /* Observation Domain ID */
        uint8_t data[];
-} __packed;
+} __attribute__((packed));
 
 #define IPFIX_HDRLEN           sizeof(struct ipfix_hdr)
 
@@ -32,7 +32,7 @@ struct ipfix_templ_hdr {
        uint16_t tid;
        uint16_t cnt;
        uint8_t data[];
-} __packed;
+} __attribute__((packed));
 
 #define IPFIX_TEMPL_HDRLEN(nfields)    sizeof(struct ipfix_templ_hdr) + (sizeof(uint16_t) * 2 * nfields)
 
@@ -42,7 +42,7 @@ struct ipfix_set_hdr {
        uint16_t id;
        uint16_t len;
        uint8_t data[];
-} __packed;
+} __attribute__((packed));
 
 #define IPFIX_SET_HDRLEN               sizeof(struct ipfix_set_hdr)
 
@@ -67,7 +67,7 @@ struct vy_ipfix_data {
        uint16_t dport;
        uint8_t l4_proto;
        uint32_t aid;                           /* Application ID */
-} __packed;
+} __attribute__((packed));
 
 #define VY_IPFIX_SID           256