Commit fac5f364 authored by Philip Withnall's avatar Philip Withnall

build: Check for [s]size_t before redefining them on MinGW

MinGW defines size_t and ssize_t for us, so we should not
unconditionally redefine them in stun/win32_common.h. Add an
AC_CHECK_TYPES configure check to avoid this.
parent cee3641b
...@@ -92,6 +92,7 @@ AC_CHECK_HEADERS([arpa/inet.h net/in.h]) ...@@ -92,6 +92,7 @@ AC_CHECK_HEADERS([arpa/inet.h net/in.h])
AC_CHECK_HEADERS([ifaddrs.h], \ AC_CHECK_HEADERS([ifaddrs.h], \
[AC_DEFINE(HAVE_GETIFADDRS, [1], \ [AC_DEFINE(HAVE_GETIFADDRS, [1], \
[Whether getifaddrs() is available on the system])]) [Whether getifaddrs() is available on the system])])
AC_CHECK_TYPES([size_t, ssize_t])
# Also put matching version in LIBNICE_CFLAGS # Also put matching version in LIBNICE_CFLAGS
GLIB_REQ=2.30 GLIB_REQ=2.30
......
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
#ifndef _WIN32_COMMON_H #ifndef _WIN32_COMMON_H
#define _WIN32_COMMON_H #define _WIN32_COMMON_H
#include "config.h"
#include <sys/types.h> #include <sys/types.h>
/* 7.18.1.1 Exact-width integer types */ /* 7.18.1.1 Exact-width integer types */
...@@ -69,8 +70,10 @@ typedef unsigned uint32_t; ...@@ -69,8 +70,10 @@ typedef unsigned uint32_t;
typedef long long int64_t; typedef long long int64_t;
typedef unsigned long long uint64_t; typedef unsigned long long uint64_t;
#ifndef _SSIZE_T_ #ifndef HAVE_SIZE_T
typedef unsigned int size_t; typedef unsigned int size_t;
#endif
#ifndef HAVE_SSIZE_T
typedef unsigned long ssize_t; typedef unsigned long ssize_t;
#endif #endif
......
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