How do I exclude the following code using conditional preprocessor
For e.g.
typedef union
{
struct
{
unsigned fb_num : 8 __attribute__ ((packed));
unsigned stream_id : 12 __attribute__ ((packed));
unsigned lossless : 1 __attribute__ ((packed));
unsigned proto_idx : 6 __attribute__ ((packed));
unsigned da_logport : 13 __attribute__ ((packed));
unsigned sa_spare_dx : 10 __attribute__ ((packed));
unsigned da_spare_idx : 10 __attribute__ ((packed));
unsigned mcast_index : 12 __attribute__ ((packed));/*
ISH_B*/
unsigned mesh_idx : 8 __attribute__ ((packed));
unsigned in_mirror : 4 __attribute__ ((packed));
unsigned vlan_idx : 12 __attribute__ ((packed));
unsigned dis_stp : 1 __attribute__ ((packed));
unsigned trkbal_idx : 5 __attribute__ ((packed));
...
<truncated>
I want to exclude this code portion: "attribute ((packed))", so that
compiler reads it as:
typedef union
{
struct
{
unsigned fb_num : 8 ;
unsigned stream_id : 12 ;
unsigned lossless : 1 ;
unsigned proto_idx : 6 ;
unsigned da_logport : 13 ;
unsigned sa_spare_dx : 10 ;
unsigned da_spare_idx : 10 ;
unsigned mcast_index : 12 ;/* ISH_B*/
unsigned mesh_idx : 8 ;
unsigned in_mirror : 4 ;
unsigned vlan_idx : 12 ;
unsigned dis_stp : 1 ;
unsigned trkbal_idx : 5 ;
...
<truncated>
Now the MACRO under which this should compile is MCAST_SIMULATION: i.e. if
MCAST_SIMULATION is defined, exclude the mentioned code portion otherwise
not. How can I accomplish this? Would be glad to get any help.
No comments:
Post a Comment