]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
frame.h uses very generic memeber names that resusts in conflicts with other defines
authorShuah Khan <shuah.khan@hp.com>
Thu, 12 Jan 2012 22:54:12 +0000 (15:54 -0700)
committerVincent Bernat <bernat@luffy.cx>
Fri, 13 Jan 2012 06:23:03 +0000 (07:23 +0100)
src/frame.h

index c7edb6b0b42da39f24cd425f79a8b8fe0e63b279..b7fae46257eecddc4799ed42e1d3530478117f79 100644 (file)
@@ -18,9 +18,9 @@
 #define _FRAME_H
 
 union {
-       uint8_t uint8;
-       uint16_t uint16;
-       uint32_t uint32;
+       uint8_t f_uint8;
+       uint16_t f_uint16;
+       uint32_t f_uint32;
 } types;
 
 /* This set of macro are used to build packets. The current position in buffer
@@ -69,9 +69,9 @@ union {
                pos += sizeof(type),                    \
                func(type)                              \
        )
-#define PEEK_UINT8 PEEK(types.uint8, )
-#define PEEK_UINT16 PEEK(types.uint16, ntohs)
-#define PEEK_UINT32 PEEK(types.uint32, ntohl)
+#define PEEK_UINT8 PEEK(types.f_uint8, )
+#define PEEK_UINT16 PEEK(types.f_uint16, ntohs)
+#define PEEK_UINT32 PEEK(types.f_uint32, ntohl)
 #define PEEK_BYTES(value, bytes)                              \
         do {                                                  \
                memcpy(value, pos, bytes);                     \
@@ -101,9 +101,9 @@ union {
        )
 #define POKE_END_LLDP_TLV                                     \
         (                                                     \
-        memcpy(&types.uint16, tlv, sizeof(uint16_t)),         \
-        types.uint16 |= htons((pos - (tlv + 2)) & 0x01ff),    \
-        memcpy(tlv, &types.uint16, sizeof(uint16_t)),         \
+        memcpy(&types.f_uint16, tlv, sizeof(uint16_t)),               \
+        types.f_uint16 |= htons((pos - (tlv + 2)) & 0x01ff),    \
+        memcpy(tlv, &types.f_uint16, sizeof(uint16_t)),               \
         1                                                     \
        )
 
@@ -116,8 +116,8 @@ union {
        )
 #define POKE_END_CDP_TLV                                      \
         (                                                     \
-        types.uint16 = htons(pos - tlv + 2),                  \
-        memcpy(tlv, &types.uint16, sizeof(uint16_t)),         \
+        types.f_uint16 = htons(pos - tlv + 2),                \
+        memcpy(tlv, &types.f_uint16, sizeof(uint16_t)),               \
         1                                                     \
        )