summaryrefslogtreecommitdiff
path: root/stun
diff options
context:
space:
mode:
authorPhilip Withnall <philip@tecnocode.co.uk>2014-08-10 23:38:23 +0100
committerOlivier CrĂȘte <olivier.crete@collabora.com>2014-08-18 14:23:36 -0400
commit489c8e1c791a172477d0f7ac7a165f4260203cf9 (patch)
treea9e0816d517356d8f62a6683d252ac19ec41ab17 /stun
parent3c764a5effc7d0fc95fcf4c64734c029c35c96d0 (diff)
downloadlibnice-489c8e1c791a172477d0f7ac7a165f4260203cf9.tar.gz
stun: Fix definition of ssize_t on Windows
ssize_t should definitely be signed, not unsigned.
Diffstat (limited to 'stun')
-rw-r--r--stun/win32_common.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/stun/win32_common.h b/stun/win32_common.h
index 61fa981..db79769 100644
--- a/stun/win32_common.h
+++ b/stun/win32_common.h
@@ -70,12 +70,22 @@ typedef unsigned uint32_t;
typedef long long int64_t;
typedef unsigned long long uint64_t;
+/* Using the [S]SIZE_T definitions from:
+ * http://msdn.microsoft.com/en-gb/library/windows/desktop/aa383751%28v=vs.85%29.aspx#SSIZE_T */
#ifndef HAVE_SIZE_T
-typedef unsigned int size_t;
+#if defined(_WIN64)
+typedef unsigned __int64 size_t;
+#else
+typedef unsigned long size_t;
#endif
+#endif /* !HAVE_SSIZE_T */
#ifndef HAVE_SSIZE_T
-typedef unsigned long ssize_t;
+#if defined(_WIN64)
+typedef signed __int64 ssize_t;
+#else
+typedef signed long ssize_t;
#endif
+#endif /* !HAVE_SSIZE_T */
typedef uint8_t bool;
#define true 1