Redefinition of s6_addr in Linux environnement
Hello,
While cross-compiling the rohc-tcp branch, I encounter a problem of redefinition for s6_addrXXX :
In file src/common/
/**
* @brief The IPv6 address
*/
struct ipv6_addr
{
union
{
} __in6_u;
#define s6_addr __in6_u.__u6_addr8
#define s6_addr16 __in6_u.__u6_addr16
#define s6_addr32 __in6_u.__u6_addr32
};
With last GCC, it is the same definitions in file /usr/include/
/* IPv6 address */
struct in6_addr
{
union
{
uint8_t __u6_addr8[16];
#if defined __USE_MISC || defined __USE_GNU
uint16_t __u6_addr16[8];
uint32_t __u6_addr32[4];
#endif
} __in6_u;
#define s6_addr __in6_u.__u6_addr8
#if defined __USE_MISC || defined __USE_GNU
# define s6_addr16 __in6_u.__u6_addr16
# define s6_addr32 __in6_u.__u6_addr32
#endif
};
But with the cross-compiler for ARM (or PowerPC), it is NOT the same definitions in file /usr/include/
/* IPv6 address */
struct in6_addr
{
union
{
uint8_t u6_addr8[16];
uint16_t u6_addr16[8];
uint32_t u6_addr32[4];
} in6_u;
#define s6_addr in6_u.u6_addr8
#define s6_addr16 in6_u.u6_addr16
#define s6_addr32 in6_u.u6_addr32
};
Can you add test for definition of _NETINET_IN_H before define s6_addrXXX in your common/
/**
* @brief The IPv6 address
*/
struct ipv6_addr
{
union
{
} __in6_u;
#ifndef _NETINET_IN_H
#define s6_addr __in6_u.__u6_addr8
#define s6_addr16 __in6_u.__u6_addr16
#define s6_addr32 __in6_u.__u6_addr32
#endif
};
Thank you,
Best regards,
FWX.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- rohc Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- FWX
- Solved:
- Last query:
- Last reply: