[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xine-cvslog
Subject:    [xine-cvs] HG: xine-lib: Fix MIN,
From:       Matthias Ringwald <mringwal () inf ! ethz ! ch>
Date:       2008-07-11 20:31:34
Message-ID: 2f4b733a43a89eb6fd26.1215613141 () hg ! debian ! org
[Download RAW message or body]

# HG changeset patch
# User Matthias Ringwald <mringwal@inf.ethz.ch>
# Date 1215613141 -7200
# Node ID 2f4b733a43a89eb6fd26993343ed53a137e23b76
# Parent  a666bb0e396fd635495798675f3d2d5281333592
Fix MIN, MAX macro replacement (mingw32 fix)

xine was already checking for MIN/MAX macros but the replacement does not
work (at least not on mingw32). This change defines HAVE_[MIN|MAX]_MACRO and
if missing, providedes them in lib/os_internal.h

diff -r 2f4b733a43a89eb6fd26993343ed53a137e23b76 -r \
                a666bb0e396fd635495798675f3d2d5281333592 configure.ac
--- a/configure.ac	Wed Jul 09 16:19:01 2008 +0200
+++ b/configure.ac	Tue Jul 08 22:49:00 2008 +0200
@@ -2159,10 +2159,10 @@ AC_CHECK_FUNC(opendir,
     AC_MSG_ERROR([dirent is needed (opendir, readdir, ...)])
   fi])
 
-XINE_CHECK_MINMAX([], [
-    AC_DEFINE([MIN(x, y)], [(x > y) ? y : x], [Get the minimum value between two])
-    AC_DEFINE([MAX(x, y)], [(x > y) ? x : y], [Get the maximum value between two])
-  ])
+XINE_CHECK_MINMAX([
+    AC_DEFINE(HAVE_MAX_MACRO, 1, [Define to 1 if you have 'MAX' macro in \
sys/param.h]) +    AC_DEFINE(HAVE_MIN_MACRO, 1, [Define to 1 if you have 'MIN' macro \
in sys/param.h]) +  ],[])
 
 dnl ---------------------------------------------
 dnl cflags and debug cflags
diff -r 2f4b733a43a89eb6fd26993343ed53a137e23b76 -r \
                a666bb0e396fd635495798675f3d2d5281333592 lib/os_internal.h
--- a/lib/os_internal.h	Wed Jul 09 16:19:01 2008 +0200
+++ b/lib/os_internal.h	Tue Jul 08 22:49:00 2008 +0200
@@ -36,6 +36,13 @@
 #  define XINE_DIRECTORY_SEPARATOR_CHAR '/'
 #endif
 
+/* replacement of min/max macros */
+#ifndef HAVE_MAX_MACRO
+#define	MAX(a,b) (((a)>(b))?(a):(b))
+#endif
+#ifndef HAVE_MIN_MACRO
+#define	MIN(a,b) (((a)<(b))?(a):(b))
+#endif
 
 /* replacement of strndup */
 #ifndef HAVE_STRNDUP

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Xine-cvslog mailing list
Xine-cvslog@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xine-cvslog


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic