Skip to content

Commit d92ebb5

Browse files
committed
jtag: esp_usb_jtag: remove macro __packed
In FreeBSB 13.0 the build fails due to redefined macro __packed. src/jtag/drivers/esp_usb_jtag.c:19:9: error: '__packed' macro redefined [-Werror,-Wmacro-redefined] #define __packed __attribute__((packed)) ^ /usr/include/sys/cdefs.h:223:9: note: previous definition is here #define __packed __attribute__((__packed__)) ^ 1 error generated. Drop the macro and align the code with the other files in OpenOCD project, where the attribute is directly applied without using a macro. Change-Id: I89ae943e77036206d40d4d54172cd4a73e76e5c5 Signed-off-by: Antonio Borneo <[email protected]> Reported-by: Wojciech Puchar <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/7435 Tested-by: jenkins Reviewed-by: Erhan Kurubas <[email protected]>
1 parent 7dd5b6a commit d92ebb5

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/jtag/drivers/esp_usb_jtag.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
#include "bitq.h"
1717
#include "libusb_helper.h"
1818

19-
#define __packed __attribute__((packed))
20-
2119
/*
2220
Holy Crap, it's protocol documentation, and it's even vendor-provided!
2321
@@ -110,7 +108,7 @@ descriptor.
110108
struct jtag_proto_caps_hdr {
111109
uint8_t proto_ver; /* Protocol version. Expects JTAG_PROTO_CAPS_VER for now. */
112110
uint8_t length; /* of this plus any following descriptors */
113-
} __packed;
111+
} __attribute__((packed));
114112

115113
/* start of the descriptor headers */
116114
#define JTAG_BUILTIN_DESCR_START_OFF 0 /* Devices with builtin usb jtag */
@@ -133,15 +131,15 @@ of caps header to assume this. If no such caps exist, assume a minimum (in) buff
133131
struct jtag_gen_hdr {
134132
uint8_t type;
135133
uint8_t length;
136-
} __packed;
134+
} __attribute__((packed));
137135

138136
struct jtag_proto_caps_speed_apb {
139137
uint8_t type; /* Type, always JTAG_PROTO_CAPS_SPEED_APB_TYPE */
140138
uint8_t length; /* Length of this */
141139
uint8_t apb_speed_10khz[2]; /* ABP bus speed, in 10KHz increments. Base speed is half this. */
142140
uint8_t div_min[2]; /* minimum divisor (to base speed), inclusive */
143141
uint8_t div_max[2]; /* maximum divisor (to base speed), inclusive */
144-
} __packed;
142+
} __attribute__((packed));
145143

146144
#define JTAG_PROTO_CAPS_DATA_LEN 255
147145
#define JTAG_PROTO_CAPS_SPEED_APB_TYPE 1

0 commit comments

Comments
 (0)