net: Fix -Wmissing-braces

This commit is contained in:
Hennadii Stepanov
2025-12-17 16:23:43 +00:00
parent 13891a8a68
commit f46e3ec0f9
5 changed files with 22 additions and 7 deletions

View File

@@ -38,6 +38,18 @@
typedef u_short sa_family_t;
#endif
// Brace style in the IN6ADDR_*_INIT macros differs across platforms.
#if defined(__illumos__)
#define COMPAT_IN6ADDR_ANY_INIT {{IN6ADDR_ANY_INIT}}
#else
#define COMPAT_IN6ADDR_ANY_INIT IN6ADDR_ANY_INIT
#endif
#if defined(__illumos__) || defined(_MSC_VER)
#define COMPAT_IN6ADDR_LOOPBACK_INIT {{IN6ADDR_LOOPBACK_INIT}}
#else
#define COMPAT_IN6ADDR_LOOPBACK_INIT IN6ADDR_LOOPBACK_INIT
#endif
// We map Linux / BSD error functions and codes, to the equivalent
// Windows definitions, and use the WSA* names throughout our code.
// Note that glibc defines EWOULDBLOCK as EAGAIN (see errno.h).