]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
curl_setup: fix missing `ADDRESS_FAMILY` type in rare build cases
authorViktor Szakats <commit@vsz.me>
Fri, 10 Jan 2025 15:58:48 +0000 (16:58 +0100)
committerViktor Szakats <commit@vsz.me>
Sat, 11 Jan 2025 23:34:21 +0000 (00:34 +0100)
Build failed when both `ADDRESS_FAMILY` and `sockaddr_un` stuct were
missing from the Windows SDK, with UnixSockets enabled.

Seen with GNU 4.4.0 in CeGCC 0.59.1:
```
lib/curl_setup.h:983: error: expected specifier-qualifier-list before 'ADDRESS_FAMILY'
lib/curl_setup.h:985: warning: struct has no members
```

Also reported with VS2003:
https://datagirl.xyz/posts/wolfssl_curl_w2k.html

Closes #15969

lib/curl_setup.h

index 582a50f69076a3ab3322c72d2f5ff621e74b988a..fe6188d39cc2a4554913273cc5c51df8f067422a 100644 (file)
@@ -976,7 +976,7 @@ int getpwuid_r(uid_t uid, struct passwd *pwd, char *buf,
 #    define UNIX_PATH_MAX 108
      /* !checksrc! disable TYPEDEFSTRUCT 1 */
      typedef struct sockaddr_un {
-       ADDRESS_FAMILY sun_family;
+       CURL_SA_FAMILY_T sun_family;
        char sun_path[UNIX_PATH_MAX];
      } SOCKADDR_UN, *PSOCKADDR_UN;
 #    define WIN32_SOCKADDR_UN