From: Todd C. Miller Date: Wed, 2 Jan 2002 22:37:19 +0000 (+0000) Subject: Move in some stuff that was previously in config.h. X-Git-Tag: SUDO_1_6_4~26 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a3e429aed937e9b8033c1d164a56a01194c1a298;p=sudo Move in some stuff that was previously in config.h. --- diff --git a/compat.h b/compat.h index ce7338fbb..170b4345b 100644 --- a/compat.h +++ b/compat.h @@ -144,6 +144,29 @@ # define MAX(a,b) (((a)>(b))?(a):(b)) #endif +/* + * Simple isblank() macro for systems without it. + */ +#ifndef HAVE_ISBLANK +# define isblank(_x) ((_x) == ' ' || (_x) == '\t') +#endif + +/* + * Old BSD systems lack strchr(), strrchr(), memset() and memcpy() + */ +#if !defined(HAVE_STRCHR) && !defined(strchr) +# define strchr(_s, _c) index(_s, _c) +#endif +#if !defined(HAVE_STRRCHR) && !defined(strrchr) +# define strrchr(_s, _c) rindex(_s, _c) +#endif +#if !defined(HAVE_MEMCPY) && !defined(memcpy) +# define memcpy(_d, _s, _n) (bcopy(_s, _d, _n)) +#endif +#if !defined(HAVE_MEMSET) && !defined(memset) +# define memset(_s, _x, _n) (bzero(_s, _n)) +#endif + /* * Emulate sete[ug]id() via setres[ug]id(2) or setre[ug]id(2) */ @@ -175,6 +198,7 @@ */ #ifdef HAVE__INNETGR # define innetgr(n, h, u, d) (_innetgr(n, h, u, d)) +# define HAVE_INNETGR 1 #endif /* HAVE__INNETGR */ /*