问题描述:

I am trying to implement the bg lib c file into my uVision project and am having problems with some errors to do with __packed:

Here is at the top of cmd_def.h:

#ifdef PACKED

#define PACKSTRUCT(a) a PACKED

#else

/* default packed configuration */

#ifdef __GNUC__

#ifdef _WIN32

#define PACKSTRUCT( decl ) decl __attribute__((__packed__,gcc_struct))

#else

#define PACKSTRUCT( decl ) decl __attribute__((__packed__))

#endif

#define ALIGNED __attribute__((aligned(0x4)))

#else // not __GNUC__

#ifdef __ARMCC_VERSION

#define PACKSTRUCT( decl ) __packed decl

#define ALIGNED

#else // MSVC

#define PACKSTRUCT( decl ) __pragma( pack(push, 1) ) decl __pragma( pack(pop) )

#define ALIGNED

#endif

#endif

#endif

and I keep on getting the following error:

cmd_def.h(987): error: #1032: Definition of nested anonymous struct in packed "struct ble_msg_flash_ps_load_rsp_t" must be __packed

Thanks!

相关阅读:
Top