Skip to content

Commit

Permalink
Remove double underscore prefix from __packed and __aligned() definit…
Browse files Browse the repository at this point in the history
…ions.

It is polluting the GCC namespace and breaks the build with GCC v9.
  • Loading branch information
keirf committed Aug 4, 2020
1 parent b63ec20 commit 7591dbb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
9 changes: 6 additions & 3 deletions inc/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
* See the file COPYING for more details, or visit <http://unlicense.org>.
*/

enum dispen { DISPCTL_tristate = 0, DISPCTL_enable_high, DISPCTL_enable_low, DISPCTL_MAX };
enum dispen { DISPCTL_tristate = 0,
DISPCTL_enable_high,
DISPCTL_enable_low,
DISPCTL_MAX };
/* PB15 is tristate outside OSD; PA15 unused
* PA15 is Display Enable: Active HIGH
* PA15 is Display Enable: Active LOW */
Expand All @@ -18,7 +21,7 @@ enum timings { DISP_15KHZ=0, DISP_VGA, DISP_AUTO, DISP_MAX };

enum polarities { SYNC_LOW=0, SYNC_HIGH, SYNC_AUTO, SYNC_MAX };

extern struct __packed config {
extern struct packed config {

uint16_t polarity;

Expand Down Expand Up @@ -53,7 +56,7 @@ extern struct __packed config {
/* Mask of user-assigned pins which are HIGH at power on. */
uint8_t user_pin_high;
uint8_t _pad;
struct __packed config_hotkey {
struct packed config_hotkey {
/* Mask of user pins modified by this hotkey. */
uint8_t pin_mod;
/* Mask of user pins driven HIGH by this hotkey.
Expand Down
4 changes: 2 additions & 2 deletions inc/intrinsics.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ struct exception_frame {
/* Force a compilation error if condition is true */
#define BUILD_BUG_ON(cond) ({ _Static_assert(!(cond), "!(" #cond ")"); })

#define __aligned(x) __attribute__((aligned(x)))
#define __packed __attribute((packed))
#define aligned(x) __attribute__((aligned(x)))
#define packed __attribute((packed))
#define always_inline __inline__ __attribute__((always_inline))
#define noinline __attribute__((noinline))

Expand Down
2 changes: 1 addition & 1 deletion inc/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ void i2c_process(void);
extern struct display i2c_display;
extern bool_t i2c_osd_protocol;
extern uint8_t i2c_buttons_rx; /* Gotek -> FF_OSD */
extern struct __packed i2c_osd_info {
extern struct packed i2c_osd_info {
uint8_t protocol_ver;
uint8_t fw_major, fw_minor;
uint8_t buttons;
Expand Down

0 comments on commit 7591dbb

Please sign in to comment.