This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

GNUC or msvc to Cx51 converting

Good day!

I am trying to run C code written for GNUC and msvc on my C8051F320 MCU (Cx51 compiler).
While compiling errors are generated, that direct me to the following lines:

#ifdef __GNUC__

#define PACKSTRUCT( decl ) decl __attribute__((__packed__))
#define ALIGNED __attribute__((aligned(0x4)))

#else //msvc

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

#endif

That is why I need to rewrite that defines macros to make Cx51 compiler understand me.
I don't know how to do this at the moment.

Thank you beforehand!

Best regards,
SANEL

Parents Reply Children
No data