on master help sign in
Merge pull request #1317 from melted/net_fix
76f8684David Christiansen
rts/idris_net.c+10
@@ -2,6 +2,16 @@
2// (C) Simon Fowler, 2014
2// (C) Simon Fowler, 2014
3// MIT Licensed. Have fun!
3// MIT Licensed. Have fun!
4#include "idris_net.h"
4#include "idris_net.h"
5+#include <errno.h>
6+#include <netdb.h>
7+#include <stdbool.h>
8+#include <stdlib.h>
9+#include <stdio.h>
10+#include <string.h>
11+#include <sys/types.h>
12+#include <sys/socket.h>
13+#include <netinet/in.h>
14+#include <arpa/inet.h>
5
15
6void buf_htonl(void* buf, int len) {
16void buf_htonl(void* buf, int len) {
7 int* buf_i = (int*) buf;
17 int* buf_i = (int*) buf;
rts/idris_net.h+2−10
@@ -1,16 +1,8 @@
1#ifndef IDRISNET_H
1#ifndef IDRISNET_H
2#define IDRISNET_H
2#define IDRISNET_H
3
3
4−#include <errno.h>
4+struct sockaddr_storage;
5−#include <netdb.h>
5+struct addrinfo;
6−#include <stdbool.h>
7−#include <stdlib.h>
8−#include <stdio.h>
9−#include <string.h>
10−#include <sys/types.h>
11−#include <sys/socket.h>
12−#include <netinet/in.h>
13−#include <arpa/inet.h>
14
6
15typedef struct idrnet_recv_result {
7typedef struct idrnet_recv_result {
16 int result;
8 int result;
rts/windows/idris_net.c+1−1
@@ -177,7 +177,7 @@ int idrnet_get_recv_res(void* res_struct) {
177 return (((idrnet_recv_result*) res_struct)->result);
177 return (((idrnet_recv_result*) res_struct)->result);
178}
178}
179
179
180−void* idrnet_get_recv_payload(void* res_struct) {
180+char* idrnet_get_recv_payload(void* res_struct) {
181 return (((idrnet_recv_result*) res_struct)->payload);
181 return (((idrnet_recv_result*) res_struct)->payload);
182}
182}
183
183