]> granicus.if.org Git - sudo/commitdiff
Move in some stuff that was previously in config.h.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 2 Jan 2002 22:37:19 +0000 (22:37 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 2 Jan 2002 22:37:19 +0000 (22:37 +0000)
compat.h

index ce7338fbb13c139e2b107f4b22066b4a1d6d2845..170b4345b6954e001515f6d190b6075650fd435b 100644 (file)
--- a/compat.h
+++ b/compat.h
 # 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)
  */
  */
 #ifdef HAVE__INNETGR
 # define innetgr(n, h, u, d)   (_innetgr(n, h, u, d))
+# define HAVE_INNETGR 1
 #endif /* HAVE__INNETGR */
 
 /*