summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2015-06-30 14:29:43 +0100
committerPhilip Withnall <philip.withnall@collabora.co.uk>2015-07-01 11:56:35 +0100
commitcd61af3114a51df53619fb0460ace2b3660fc5da (patch)
tree38b1607cd4740cb92b5e2fbf8eb369f1dc030677
parent3cccc311b1becf4307f5a4004734d8f7b2cf84f6 (diff)
downloadlibnice-cd61af3114a51df53619fb0460ace2b3660fc5da.tar.gz
pseudotcp: Only define errnos on Windows if not already defined
Recent versions of MinGW define at least ECONNABORTED and EAFNOSUPPORT, so only define the various socket errnos if they are not defined already. Based on a patch by Alexey Pawlow <alexey.pawlow@gmail.com> and Felix <felixschlitter@gmail.com>. Reviewed-by: Olivier Crete <olivier.crete@collabora.com> Reviewed-by: Felix Schlitter <felixschlitter@gmail.com> http://phabricator.freedesktop.org/T122
-rw-r--r--agent/pseudotcp.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/agent/pseudotcp.h b/agent/pseudotcp.h
index 879276e..bb0d476 100644
--- a/agent/pseudotcp.h
+++ b/agent/pseudotcp.h
@@ -62,12 +62,24 @@
#ifndef __GTK_DOC_IGNORE__
#ifdef G_OS_WIN32
# include <winsock2.h>
+
+#ifndef ECONNABORTED
# define ECONNABORTED WSAECONNABORTED
+#endif
+
+#ifndef ENOTCONN
# define ENOTCONN WSAENOTCONN
+#endif
+
+#ifndef EWOULDBLOCK
# define EWOULDBLOCK WSAEWOULDBLOCK
+#endif
+
+#ifndef ECONNRESET
# define ECONNRESET WSAECONNRESET
#endif
#endif
+#endif
#include "agent.h"