I am trying to change the structure packing to 1 byte. I want to do it using a C compiler flag in makefile that should take care for all the structures in the code by defining them to be 1 byte aligned.
I have tried this, and I can do the thing using this in code
#if (PRAGMA_PACK)
#pragma pack (1)
#endif
typedef PACKED struct _stsomefn
{
}stsomefn;
PRAGMA_PACK
is set in makefile using
CDEFS += -DPRAGMA_PACK=1
This has worked, of course it will. The problem here is I do not want to change this code. So that is why I am asking a MACRO which will be defined in makefile to do the same thing.