[libc] add various macros relate to *ADDR* (#164830)
This patch adds 4 macros in the `netinet/in.h` header, as specified by POSIX standards.
This commit is contained in:
parent
3226a5f982
commit
ffb5831fce
@ -9,6 +9,9 @@
|
||||
#ifndef LLVM_LIBC_MACROS_NETINET_IN_MACROS_H
|
||||
#define LLVM_LIBC_MACROS_NETINET_IN_MACROS_H
|
||||
|
||||
#include "../llvm-libc-types/in_addr_t.h"
|
||||
#include "__llvm-libc-common.h"
|
||||
|
||||
#define IPPROTO_IP 0
|
||||
#define IPPROTO_ICMP 1
|
||||
#define IPPROTO_TCP 6
|
||||
@ -24,4 +27,10 @@
|
||||
#define IPV6_LEAVE_GROUP 21
|
||||
#define IPV6_V6ONLY 26
|
||||
|
||||
#define INADDR_ANY __LLVM_LIBC_CAST(static_cast, in_addr_t, 0x00000000)
|
||||
#define INADDR_BROADCAST __LLVM_LIBC_CAST(static_cast, in_addr_t, 0xffffffff)
|
||||
|
||||
#define INET_ADDRSTRLEN 16
|
||||
#define INET6_ADDRSTRLEN 46
|
||||
|
||||
#endif // LLVM_LIBC_MACROS_NETINET_IN_MACROS_H
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user