Browse code

Add MIN() compatibility macro

commit 3b23b18dddb8f8f4a introduced usage of MIN(), and not all platforms
have the macro in "readily usable" system header files, most notably it's
missing on OpenSolaris and Android. Add macro if not defined yet.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <20130323112234.GM17727@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7450

Gert Doering authored on 2013/03/23 18:28:48
Showing 1 changed files
... ...
@@ -399,6 +399,13 @@
399 399
 #endif
400 400
 
401 401
 /*
402
+ * do we have the MIN() macro?
403
+ */
404
+#ifndef MIN
405
+#define MIN(a,b) (((a)<(b))?(a):(b))
406
+#endif
407
+
408
+/*
402 409
  * Do we have the capability to report extended socket errors?
403 410
  */
404 411
 #if defined(HAVE_LINUX_TYPES_H) && defined(HAVE_LINUX_ERRQUEUE_H) && defined(HAVE_SOCK_EXTENDED_ERR) && defined(HAVE_MSGHDR) && defined(HAVE_CMSGHDR) && defined(CMSG_FIRSTHDR) && defined(CMSG_NXTHDR) && defined(IP_RECVERR) && defined(MSG_ERRQUEUE) && defined(SOL_IP) && defined(HAVE_IOVEC)