diff options
Diffstat (limited to 'toxcore/network.h')
-rw-r--r-- | toxcore/network.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/toxcore/network.h b/toxcore/network.h index eb725d25..ca79a81b 100644 --- a/toxcore/network.h +++ b/toxcore/network.h | |||
@@ -120,7 +120,12 @@ typedef struct { | |||
120 | typedef struct { | 120 | typedef struct { |
121 | Packet_Handles packethandlers[256]; | 121 | Packet_Handles packethandlers[256]; |
122 | /* Our UDP socket. */ | 122 | /* Our UDP socket. */ |
123 | #ifdef WIN32 | ||
124 | unsigned int sock; | ||
125 | #else | ||
123 | int sock; | 126 | int sock; |
127 | #endif | ||
128 | |||
124 | } Networking_Core; | 129 | } Networking_Core; |
125 | 130 | ||
126 | /* return current time in milleseconds since the epoch. */ | 131 | /* return current time in milleseconds since the epoch. */ |
@@ -134,7 +139,12 @@ uint32_t random_int(void); | |||
134 | /* Basic network functions: */ | 139 | /* Basic network functions: */ |
135 | 140 | ||
136 | /* Function to send packet(data) of length length to ip_port. */ | 141 | /* Function to send packet(data) of length length to ip_port. */ |
142 | #ifdef WIN32 | ||
143 | int sendpacket(unsigned int sock, IP_Port ip_port, uint8_t *data, uint32_t length); | ||
144 | #else | ||
137 | int sendpacket(int sock, IP_Port ip_port, uint8_t *data, uint32_t length); | 145 | int sendpacket(int sock, IP_Port ip_port, uint8_t *data, uint32_t length); |
146 | #endif | ||
147 | |||
138 | 148 | ||
139 | /* Function to call when packet beginning with byte is received. */ | 149 | /* Function to call when packet beginning with byte is received. */ |
140 | void networking_registerhandler(Networking_Core *net, uint8_t byte, packet_handler_callback cb, void *object); | 150 | void networking_registerhandler(Networking_Core *net, uint8_t byte, packet_handler_callback cb, void *object); |