From: Matthias R. <mri...@in...> - 2008-07-11 20:31:27
|
# HG changeset patch # User Matthias Ringwald <mri...@in...> # 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 |