Define bcmp() using memcmp() on systems lacking native bcmp()

See 1e61e7a02f for equivalent changes
for bzero() and bcopy()
This commit is contained in:
Andrew Bettison 2013-05-17 13:59:42 +09:30
parent 628fba6208
commit f8386d5aed
2 changed files with 7 additions and 2 deletions

View File

@ -69,8 +69,7 @@ AC_CHECK_LIB(c,srandomdev)
dnl Solaris hides nanosleep here
AC_CHECK_LIB(rt,nanosleep)
dnl BSD way of getting socket creds
AC_CHECK_FUNCS([getpeereid bcopy bzero])
AC_CHECK_FUNCS([getpeereid bcopy bzero bcmp])
AC_CHECK_HEADERS(
stdio.h \

6
os.h
View File

@ -69,6 +69,12 @@ __SERVALDNA_OS_INLINE void bcopy(void *src, void *dst, size_t len) {
}
#endif
#ifndef HAVE_BCMP
__SERVALDNA_OS_INLINE int bcmp(const void *s1, const void *s2) {
return memcmp(s1, s2);
}
#endif
/* The "e" variants log the error before returning -1.
*/
int mkdirs(const char *path, mode_t mode);