Hi,

MIN() fix for on OpenSolaris 10, fixes build there.  Should fix building
on Android, too.

gert


From a83e41b61af045ebb97ba8e274bfb4cfe8a05232 Mon Sep 17 00:00:00 2001
From: Gert Doering <g...@greenie.muc.de>
List-Post: openvpn-devel@lists.sourceforge.net
Date: Sat, 23 Mar 2013 10:28:48 +0100
Subject: [PATCH] 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 <g...@greenie.muc.de>
---
 src/openvpn/syshead.h |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/openvpn/syshead.h b/src/openvpn/syshead.h
index b14214d..4db29cc 100644
--- a/src/openvpn/syshead.h
+++ b/src/openvpn/syshead.h
@@ -399,6 +399,13 @@
 #endif
 
 /*
+ * do we have the MIN() macro?
+ */
+#ifndef MIN
+#define MIN(a,b) (((a)<(b))?(a):(b))
+#endif
+
+/*
  * Do we have the capability to report extended socket errors?
  */
 #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)
-- 
1.5.6.5

-- 
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             g...@greenie.muc.de
fax: +49-89-35655025                        g...@net.informatik.tu-muenchen.de

Attachment: pgpkIgvfEisr0.pgp
Description: PGP signature

Reply via email to