Commit 50455d76 authored by Youness Alaoui's avatar Youness Alaoui

Fix includes for win32 compilation

parent 25c8b837
...@@ -47,12 +47,15 @@ ...@@ -47,12 +47,15 @@
# include "config.h" # include "config.h"
#endif #endif
#include <unistd.h> #include "tcp-turn.h"
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include "tcp-turn.h" #ifndef G_OS_WIN32
#include <unistd.h>
#endif
typedef struct { typedef struct {
NiceUdpTurnSocketCompatibility compatibility; NiceUdpTurnSocketCompatibility compatibility;
......
...@@ -46,13 +46,18 @@ ...@@ -46,13 +46,18 @@
#endif #endif
#include <unistd.h>
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include "udp-bsd.h" #include "udp-bsd.h"
#ifdef G_OS_WIN32
typedef unsigned long ssize_t;
#else
#include <unistd.h>
#endif
/*** NiceSocket ***/ /*** NiceSocket ***/
static int sock_recv_err (int fd) static int sock_recv_err (int fd)
{ {
......
...@@ -45,7 +45,6 @@ ...@@ -45,7 +45,6 @@
# include "config.h" # include "config.h"
#endif #endif
#include <unistd.h>
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
......
...@@ -39,9 +39,14 @@ ...@@ -39,9 +39,14 @@
#ifndef _STUN_3489BIS_H #ifndef _STUN_3489BIS_H
#define _STUN_3489BIS_H #define _STUN_3489BIS_H
#ifdef _WIN32
#include "win32_common.h"
#else
# include <stdint.h> # include <stdint.h>
# include <sys/types.h>
# include <stdbool.h> # include <stdbool.h>
#endif
# include <sys/types.h>
/** /**
......
...@@ -35,9 +35,16 @@ ...@@ -35,9 +35,16 @@
#ifndef _STUN_AGENT_H #ifndef _STUN_AGENT_H
#define _STUN_AGENT_H #define _STUN_AGENT_H
#ifdef _WIN32
#include "win32_common.h"
#else
#include <stdint.h> #include <stdint.h>
#include <sys/types.h>
#include <stdbool.h> #include <stdbool.h>
#endif
#include <sys/types.h>
typedef struct stun_agent_t StunAgent; typedef struct stun_agent_t StunAgent;
......
...@@ -38,7 +38,13 @@ ...@@ -38,7 +38,13 @@
#ifndef _CRC32_H #ifndef _CRC32_H
#define _CRC32_H #define _CRC32_H
#ifdef _WIN32
#include "win32_common.h"
#else
#include <stdint.h> #include <stdint.h>
#endif
#include <stdlib.h> #include <stdlib.h>
typedef struct { typedef struct {
......
...@@ -36,9 +36,14 @@ ...@@ -36,9 +36,14 @@
#define _STUN_MESSAGE_H #define _STUN_MESSAGE_H
#ifdef _WIN32
#include "win32_common.h"
#else
#include <stdint.h> #include <stdint.h>
#include <sys/types.h>
#include <stdbool.h> #include <stdbool.h>
#endif
#include <sys/types.h>
#include "constants.h" #include "constants.h"
#ifdef _WIN32 #ifdef _WIN32
......
...@@ -39,9 +39,13 @@ ...@@ -39,9 +39,13 @@
#ifdef _WIN32 #ifdef _WIN32
#include <winsock2.h> #include <winsock2.h>
#include "win32_common.h"
#else #else
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <stdbool.h>
#include <unistd.h>
#include <sys/time.h>
#endif #endif
#include "bind.h" #include "bind.h"
...@@ -50,11 +54,8 @@ ...@@ -50,11 +54,8 @@
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdbool.h>
#include <time.h> #include <time.h>
#include <errno.h> #include <errno.h>
#include <unistd.h>
#include <sys/time.h>
#include <fcntl.h> #include <fcntl.h>
#include "timer.h" #include "timer.h"
#include "trans.h" #include "trans.h"
......
...@@ -41,8 +41,13 @@ ...@@ -41,8 +41,13 @@
* @brief STUN binding discovery * @brief STUN binding discovery
*/ */
#ifdef _WIN32
#include "win32_common.h"
#else
# include <stdbool.h> # include <stdbool.h>
# include <stdint.h> # include <stdint.h>
#endif
# include "stun/stunagent.h" # include "stun/stunagent.h"
......
...@@ -37,14 +37,20 @@ ...@@ -37,14 +37,20 @@
# include <config.h> # include <config.h>
#endif #endif
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#else
#include <sys/time.h>
#include <unistd.h>
#endif
#include "timer.h" #include "timer.h"
#include <stdlib.h> /* div() */ #include <stdlib.h> /* div() */
#include <time.h> #include <time.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/time.h>
#include <unistd.h>
/** /**
......
...@@ -41,8 +41,6 @@ ...@@ -41,8 +41,6 @@
#include <string.h> #include <string.h>
#include <assert.h> #include <assert.h>
#include <sys/time.h>
#include <unistd.h>
#ifdef _WIN32 #ifdef _WIN32
#define ENOENT -1 #define ENOENT -1
...@@ -58,6 +56,7 @@ ...@@ -58,6 +56,7 @@
#define close closesocket #define close closesocket
#else #else
#include <errno.h> #include <errno.h>
#include <unistd.h>
#endif #endif
......
...@@ -44,16 +44,15 @@ ...@@ -44,16 +44,15 @@
#ifdef _WIN32 #ifdef _WIN32
#include <winsock2.h> #include <winsock2.h>
#include <ws2tcpip.h> #include <ws2tcpip.h>
#include "win32_common.h"
#else #else
#include <sys/socket.h> #include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <stdint.h>
#include <stdbool.h>
#endif #endif
#include <stdint.h>
#include <sys/types.h> #include <sys/types.h>
#include <stdbool.h>
typedef struct stun_trans_s typedef struct stun_trans_s
......
...@@ -49,9 +49,6 @@ ...@@ -49,9 +49,6 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdbool.h>
#include <unistd.h>
#include <sys/time.h>
#include <fcntl.h> #include <fcntl.h>
......
...@@ -40,9 +40,12 @@ ...@@ -40,9 +40,12 @@
* @file bind.h * @file bind.h
* @brief STUN binding discovery * @brief STUN binding discovery
*/ */
#ifdef _WIN32
#include "win32_common.h"
#else
# include <stdbool.h> # include <stdbool.h>
# include <stdint.h> # include <stdint.h>
#endif
# include "stun/stunagent.h" # include "stun/stunagent.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment