From c1154bf696b0b3ad22126a76750d610e32e2ffc1 Mon Sep 17 00:00:00 2001
From: Etienne Dechamps <etienne@edechamps.fr>
Date: Sun, 17 May 2015 22:21:11 +0100
Subject: [PATCH] Make sure the MIN() macro is defined.

On MinGW this is not automatically the case, thereby breaking the build.
---
 src/meta.c          | 4 ++++
 src/protocol_misc.c | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/src/meta.c b/src/meta.c
index a05c7bd2..260cb005 100644
--- a/src/meta.c
+++ b/src/meta.c
@@ -30,6 +30,10 @@
 #include "utils.h"
 #include "xalloc.h"
 
+#ifndef MIN
+#define MIN(x, y) (((x)<(y))?(x):(y))
+#endif
+
 bool send_meta_sptps(void *handle, uint8_t type, const void *buffer, size_t length) {
 	connection_t *c = handle;
 
diff --git a/src/protocol_misc.c b/src/protocol_misc.c
index 6e242742..de426c78 100644
--- a/src/protocol_misc.c
+++ b/src/protocol_misc.c
@@ -30,6 +30,10 @@
 #include "utils.h"
 #include "xalloc.h"
 
+#ifndef MIN
+#define MIN(x, y) (((x)<(y))?(x):(y))
+#endif
+
 int maxoutbufsize = 0;
 int mtu_info_interval = 5;
 int udp_info_interval = 5;
-- 
2.39.5