Extract check for RSTRING_SOCKLEN
This commit is contained in:
parent
1c7bf378a1
commit
4bc343b436
Notes:
git
2023-01-30 12:56:04 +00:00
@ -347,10 +347,22 @@ have_type("struct sockaddr_storage", headers)
|
||||
|
||||
have_type("struct addrinfo", headers)
|
||||
|
||||
if have_type("socklen_t", headers)
|
||||
if try_static_assert("sizeof(socklen_t) >= sizeof(long)", headers)
|
||||
$defs << "-DRSTRING_SOCKLEN=(socklen_t)RSTRING_LEN"
|
||||
def check_socklen(headers)
|
||||
def (fmt = "none").%(x)
|
||||
x || self
|
||||
end
|
||||
s = checking_for("RSTRING_SOCKLEN", fmt) do
|
||||
if try_static_assert("sizeof(socklen_t) >= sizeof(long)", headers)
|
||||
"RSTRING_LEN"
|
||||
else
|
||||
"RSTRING_LENINT"
|
||||
end
|
||||
end
|
||||
$defs << "-DRSTRING_SOCKLEN=(socklen_t)"+s
|
||||
end
|
||||
|
||||
if have_type("socklen_t", headers)
|
||||
check_socklen(headers)
|
||||
end
|
||||
|
||||
have_type("struct in_pktinfo", headers) {|src|
|
||||
|
Loading…
x
Reference in New Issue
Block a user