I have the following structs:
typedef struct cxt_simple_socket_address_s
{
int is_ipv6;
cs_inaddr_t ip;
unsigned short ip_port;
} cxt_simple_socket_address_t;
typedef struct cs_inaddr
{
union {
struct in6_addr in6;
struct
{
uint8_t pad[12];
uint32_t in;
};
long long as_longs[2];
};
} cs_inaddr_t;
I would like to initialize a struct of type cxt_simple_socket_address_t upon declaration:
cxt_simple_socket_address_t any = {.in = INADDR_ANY};
This line doesn't compile. I have tried countless other variations, but I believe my problem is than .in is found within an anonymous struct inside an anonymous union.
HELP?