mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 00:35:39 +03:00
Fix pointer alignment to 8 bytes for MacOS unit tests (#13564)
This commit is contained in:
parent
e0c0b64a4b
commit
407ca40cbc
3 changed files with 15 additions and 3 deletions
|
@ -224,6 +224,12 @@ typedef union {
|
||||||
int32_t d32Max; // used for MODE_DIRECT with VAR_INT32
|
int32_t d32Max; // used for MODE_DIRECT with VAR_INT32
|
||||||
} cliValueConfig_t;
|
} cliValueConfig_t;
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
|
#define PTR_PACKING
|
||||||
|
#else
|
||||||
|
#define PTR_PACKING __attribute__((packed))
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct clivalue_s {
|
typedef struct clivalue_s {
|
||||||
const char *name;
|
const char *name;
|
||||||
const uint8_t type; // see cliValueFlag_e
|
const uint8_t type; // see cliValueFlag_e
|
||||||
|
@ -231,7 +237,7 @@ typedef struct clivalue_s {
|
||||||
|
|
||||||
pgn_t pgn;
|
pgn_t pgn;
|
||||||
uint16_t offset;
|
uint16_t offset;
|
||||||
} __attribute__((packed)) clivalue_t;
|
} PTR_PACKING clivalue_t;
|
||||||
|
|
||||||
|
|
||||||
extern const lookupTableEntry_t lookupTables[];
|
extern const lookupTableEntry_t lookupTables[];
|
||||||
|
|
|
@ -58,6 +58,12 @@ typedef enum
|
||||||
|
|
||||||
typedef const void *(*CMSEntryFuncPtr)(displayPort_t *displayPort, const void *ptr);
|
typedef const void *(*CMSEntryFuncPtr)(displayPort_t *displayPort, const void *ptr);
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
|
#define PTR_PACKING
|
||||||
|
#else
|
||||||
|
#define PTR_PACKING __attribute__((packed))
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
const char * text;
|
const char * text;
|
||||||
|
@ -65,7 +71,7 @@ typedef struct
|
||||||
uint16_t flags;
|
uint16_t flags;
|
||||||
CMSEntryFuncPtr func;
|
CMSEntryFuncPtr func;
|
||||||
void *data;
|
void *data;
|
||||||
} __attribute__((packed)) OSD_Entry;
|
} PTR_PACKING OSD_Entry;
|
||||||
|
|
||||||
// Bits in flags
|
// Bits in flags
|
||||||
#define OSD_MENU_ELEMENT_MASK 0x001f
|
#define OSD_MENU_ELEMENT_MASK 0x001f
|
||||||
|
|
|
@ -67,7 +67,7 @@ static inline uint16_t pgElementSize(const pgRegistry_t* reg) {return (reg->size
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
extern const pgRegistry_t __pg_registry_start[] __asm("section$start$__DATA$__pg_registry");
|
extern const pgRegistry_t __pg_registry_start[] __asm("section$start$__DATA$__pg_registry");
|
||||||
extern const pgRegistry_t __pg_registry_end[] __asm("section$end$__DATA$__pg_registry");
|
extern const pgRegistry_t __pg_registry_end[] __asm("section$end$__DATA$__pg_registry");
|
||||||
#define PG_REGISTER_ATTRIBUTES __attribute__ ((section("__DATA,__pg_registry"), used, aligned(4)))
|
#define PG_REGISTER_ATTRIBUTES __attribute__ ((section("__DATA,__pg_registry"), used, aligned(8)))
|
||||||
|
|
||||||
extern const uint8_t __pg_resetdata_start[] __asm("section$start$__DATA$__pg_resetdata");
|
extern const uint8_t __pg_resetdata_start[] __asm("section$start$__DATA$__pg_resetdata");
|
||||||
extern const uint8_t __pg_resetdata_end[] __asm("section$end$__DATA$__pg_resetdata");
|
extern const uint8_t __pg_resetdata_end[] __asm("section$end$__DATA$__pg_resetdata");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue