[syslog-ng][patch] fixing MIN/MAX bug

Enrico Weigelt syslog-ng@lists.balabit.hu
Mon, 25 Oct 2004 17:30:27 +0200


--xHFwDpU9dbj6ez1V
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline


hi folks,


here's a patch that fixes the missing MIN/MAX macros on certain
environments (probably libc-dependent ?)


cu
-- 
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service

  phone:     +49 36207 519931         www:       http://www.metux.de/
  fax:       +49 36207 519932         email:     contact@metux.de
  cellphone: +49 174 7066481
---------------------------------------------------------------------
 -- DSL ab 0 Euro. -- statische IP -- UUCP -- Hosting -- Webshops --
---------------------------------------------------------------------

--xHFwDpU9dbj6ez1V
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="minmax.diff"

diff -ru syslog-ng-1.5.26.orig/PATCHING syslog-ng-1.5.26/PATCHING
--- syslog-ng-1.5.26.orig/PATCHING	Mon Oct 25 15:09:33 2004
+++ syslog-ng-1.5.26/PATCHING Oct 25 15:12:09 2004
@@ -0,0 +1,3 @@
+# Patched:	minmax.diff	-v2	2004-10-25
+#	|	Enrico Weigelt <weigelt@metux.de>
+#	|	fixes undeclared MIN() and MAX macros
+
diff -ru syslog-ng-1.5.26.orig/src/cfg-lex.c syslog-ng-1.5.26/src/cfg-lex.c
--- syslog-ng-1.5.26.orig/src/cfg-lex.c	Wed Jan  8 16:38:35 2003
+++ syslog-ng-1.5.26/src/cfg-lex.c	Mon Oct 25 16:41:08 2004
@@ -8,6 +8,13 @@
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
 
+#ifndef MIN
+#define MIN(a,b) ((a) < (b) ? (a) : (b))
+#endif
+#ifndef MAX
+#define MAX(a,b) ((a) > (b) ? (a) : (b))
+#endif
+
 #include <stdio.h>
 #include <errno.h>
 
diff -ru syslog-ng-1.5.26.orig/src/sources.c syslog-ng-1.5.26/src/sources.c
--- syslog-ng-1.5.26.orig/src/sources.c	Wed Jan  8 10:31:37 2003
+++ syslog-ng-1.5.26/src/sources.c	Mon Oct 25 16:41:17 2004
@@ -43,6 +43,13 @@
 #include "sources.c.x"
 #include "nscache.h"
 
+#ifndef MIN
+#define MIN(a,b) ((a) < (b) ? (a) : (b))
+#endif
+#ifndef MAX
+#define MAX(a,b) ((a) > (b) ? (a) : (b))
+#endif
+
 /* CLASS:
      (class
        (name log_reader)
diff -ru syslog-ng-1.5.26.orig/src/affile.c syslog-ng-1.5.26/src/affile.c
--- syslog-ng-1.5.26.orig/src/affile.c	Mon Oct 25 17:25:44 2004
+++ syslog-ng-1.5.26/src/affile.c	Mon Oct 25 17:26:40 2004
@@ -55,6 +55,13 @@
  * SUCH DAMAGE.
  */
 
+#ifndef MIN
+#	define MIN(a,b) ((a) < (b) ? (a) : (b))
+#endif
+#ifndef MAX
+#	define MAX(a,b) ((a) > (b) ? (a) : (b))
+#endif
+
 #include "affile.h"
 #include "format.h"
 #include "pkt_buffer.h"
diff -ru syslog-ng-1.5.26.orig/src/afinet.c syslog-ng-1.5.26/src/afinet.c
--- syslog-ng-1.5.26.orig/src/afinet.c	Mon Oct 25 17:25:44 2004
+++ syslog-ng-1.5.26/src/afinet.c	Mon Oct 25 17:27:05 2004
@@ -23,6 +23,13 @@
  *
  ***************************************************************************/
 
+#ifndef MIN
+#	define MIN(a,b) ((a) < (b) ? (a) : (b))
+#endif
+#ifndef MAX
+#	define MAX(a,b) ((a) > (b) ? (a) : (b))
+#endif
+
 #include "afsocket.h"
 #include "format.h"
 #include "cfgfile.h"

--xHFwDpU9dbj6ez1V--