Skip to content

Commit 28e7be8

Browse files
committed
add bsd headers
1 parent 4415430 commit 28e7be8

23 files changed

Lines changed: 6512 additions & 1 deletion

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cube
22
deps
3-
include
3+
/include
44
lib
55
wii
66
build

external/bsd/include/arpa/inet.h

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// FreeBSD's header was so full of s*it, I just picked libctru's version of <arpa/inet.h>
2+
3+
#pragma once
4+
5+
#include <netinet/in.h>
6+
#include <stdint.h>
7+
8+
static inline uint32_t htonl(uint32_t hostlong)
9+
{
10+
return __builtin_bswap32(hostlong);
11+
}
12+
13+
static inline uint16_t htons(uint16_t hostshort)
14+
{
15+
return __builtin_bswap16(hostshort);
16+
}
17+
18+
static inline uint32_t ntohl(uint32_t netlong)
19+
{
20+
return __builtin_bswap32(netlong);
21+
}
22+
23+
static inline uint16_t ntohs(uint16_t netshort)
24+
{
25+
return __builtin_bswap16(netshort);
26+
}
27+
28+
#ifdef __cplusplus
29+
extern "C" {
30+
#endif
31+
32+
in_addr_t inet_addr(const char *cp);
33+
int inet_aton(const char *cp, struct in_addr *inp);
34+
char* inet_ntoa(struct in_addr in);
35+
36+
const char *inet_ntop(int af, const void * src, char * dst, socklen_t size);
37+
int inet_pton(int af, const char * src, void * dst);
38+
39+
#ifdef __cplusplus
40+
}
41+
#endif

0 commit comments

Comments
 (0)