From: Stephen D. <sd...@us...> - 2005-10-09 04:42:43
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14787/nsd Modified Files: config.c driver.c Log Message: * include/ns.h: * nsd/config.c: * nsd/driver.c: Add definition of MIN and MAX macros used by fastpath.c if not already defined, which aren't standard on e.g. Linux. Convert config.c and driver.c to use this common definition. Index: driver.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/driver.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** driver.c 8 Oct 2005 12:06:07 -0000 1.22 --- driver.c 9 Oct 2005 04:42:30 -0000 1.23 *************** *** 38,43 **** NS_RCSID("@(#) $Header$"); - #define _MAX(x,y) ((x) > (y) ? (x) : (y)) - #define _MIN(x,y) ((x) > (y) ? (y) : (x)) /* --- 38,41 ---- *************** *** 1441,1445 **** if (sockPtr->tfd > 0) { buf.iov_base = tbuf; ! buf.iov_len = _MIN(nread,sizeof(tbuf)); } else { Tcl_DStringSetLength(bufPtr, len + nread); --- 1439,1443 ---- if (sockPtr->tfd > 0) { buf.iov_base = tbuf; ! buf.iov_len = MIN(nread, sizeof(tbuf)); } else { Tcl_DStringSetLength(bufPtr, len + nread); Index: config.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/config.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** config.c 8 Oct 2005 12:06:07 -0000 1.5 --- config.c 9 Oct 2005 04:42:30 -0000 1.6 *************** *** 40,45 **** #define ISSLASH(c) ((c) == '/' || (c) == '\\') - #define _MAX(x,y) ((x) > (y) ? (x) : (y)) - #define _MIN(x,y) ((x) > (y) ? (y) : (x)) /* --- 40,43 ---- *************** *** 165,170 **** value = Ns_ConfigInt(section, key, def); ! value = _MAX(value, min); ! value = _MIN(value, max); return value; --- 163,168 ---- value = Ns_ConfigInt(section, key, def); ! value = MAX(value, min); ! value = MIN(value, max); return value; |