add platform_h for socket.c

This commit is contained in:
pikastech 2022-08-26 17:55:17 +08:00
parent 127919697d
commit 3d97469e25
3 changed files with 8 additions and 5 deletions

View File

@ -2,9 +2,10 @@
#include "_socket_socket.h" #include "_socket_socket.h"
#ifdef __linux__ #ifdef __linux__
#include <arpa/inet.h> #include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <unistd.h> #include <unistd.h>
#else
/* you need to implement this for your platform */
#include "__platform_socket.h"
#endif #endif
PIKA_WEAK int __platform_socket(int __domain, int __type, int __protocol) { PIKA_WEAK int __platform_socket(int __domain, int __type, int __protocol) {

View File

@ -14,6 +14,7 @@
"types.h": "c", "types.h": "c",
"_socket.h": "c", "_socket.h": "c",
"random.h": "c", "random.h": "c",
"cstdlib": "c" "cstdlib": "c",
"inet.h": "c"
} }
} }

View File

@ -2,9 +2,10 @@
#include "_socket_socket.h" #include "_socket_socket.h"
#ifdef __linux__ #ifdef __linux__
#include <arpa/inet.h> #include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <unistd.h> #include <unistd.h>
#else
/* you need to implement this for your platform */
#include "__platform_socket.h"
#endif #endif
PIKA_WEAK int __platform_socket(int __domain, int __type, int __protocol) { PIKA_WEAK int __platform_socket(int __domain, int __type, int __protocol) {