Skip to content

netinet/in.h: s6_addr first in struct in6_addr's union - #748

Open
WizzardSK wants to merge 1 commit into
switchbrew:masterfrom
WizzardSK:in6addr-s6addr-first
Open

WizzardSK wants to merge 1 commit into
switchbrew:masterfrom
WizzardSK:in6addr-s6addr-first

Conversation

@WizzardSK

Copy link
Copy Markdown

A braced initializer without designators fills a union's first member. struct in6_addr here starts with uint16_t __u6_addr16[8], so the common 16-byte form, {{{ 0x00, ..., 0xff, 0xff, 0x7f, 0x00, 0x00, 0x01 }}}, fails with "too many initializers for 'uint16_t [8]'". FreeBSD, glibc and musl all put the 16 bytes first. zpl-c/enet's dual-stack constants are one case that doesn't build because of it (PPSSPP's Switch libretro core, hrydgard/ppsspp#22153).

This moves s6_addr to the top of the union; size, layout and member names are unchanged. The only initializer of the type in libnx itself, in6addr_any = {0}, is the same either way.

A braced initializer without designators fills a union's first member, so
the common 16-byte form of an IPv6 address did not compile here (too many
initializers for 'uint16_t [8]'). FreeBSD, glibc and musl put the 16 bytes
first. Size, layout and member names are unchanged.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant