Skip to content

Commit

Permalink
Use appropriate socket includes on WIN32
Browse files Browse the repository at this point in the history
Patch by linfk.
  • Loading branch information
pasky committed Jan 22, 2012
1 parent 48d08b7 commit 4ddb2ca
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions distributed/protocol.h
@@ -1,8 +1,13 @@
#ifndef PACHI_DISTRIBUTED_PROTOCOL_H
#define PACHI_DISTRIBUTED_PROTOCOL_H

#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#else
#include <sys/socket.h>
#include <arpa/inet.h>
#endif

#include "board.h"

Expand Down
6 changes: 6 additions & 0 deletions network.c
Expand Up @@ -10,8 +10,14 @@
#include <errno.h>
#include <pthread.h>
#include <sys/types.h>

#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#else
#include <sys/socket.h>
#include <netdb.h>
#endif

#include "debug.h"
#include "util.h"
Expand Down
4 changes: 4 additions & 0 deletions network.h
@@ -1,7 +1,11 @@
#ifndef PACHI_NETWORK_H
#define PACHI_NETWORK_H

#ifdef _WIN32
#include <winsock2.h>
#else
#include <netinet/in.h>
#endif

int port_listen(char *port, int max_connections);
int open_server_connection(int socket, struct in_addr *client);
Expand Down

0 comments on commit 4ddb2ca

Please sign in to comment.