I know zig is not support macro.
But in c language, often use macro in struct (eg.RFC protocol).
I want to find a more zig-native way convert to zig.
for sample:
c code to define rtp header( rtp is an rfc protocol):
typedef struct {
#if RTP_BIG_ENDIAN
unsigned int version:2; /* protocol version */
unsigned int p:1; /* padding flag */
unsigned int x:1; /* header extension flag */
unsigned int cc:4; /* CSRC count */
unsigned int m:1; /* marker bit */
unsigned int pt:7; /* payload type */
#else
unsigned int cc:4; /* CSRC count */
unsigned int x:1; /* header extension flag */
unsigned int p:1; /* padding flag */
unsigned int version:2; /* protocol version */
unsigned int pt:7; /* payload type */
unsigned int m:1; /* marker bit */
#endif
unsigned int seq:16; /* sequence number */
uint32_t ts; /* timestamp */
uint32_t ssrc; /* synchronization source */
uint32_t csrc[1]; /* optional CSRC list */
} rtp_hdr_t;
Is there a ‘standard’ way convert it to zig code?