diff --git a/helper.c b/helper.c index c9aa51e4f..6959535d2 100644 --- a/helper.c +++ b/helper.c @@ -45,18 +45,15 @@ #include "rc4.h" #include "xmalloc.h" - +#include "config.h" #include "helper.h" +#ifndef HAVE_ARC4RANDOM + void get_random_bytes(unsigned char *buf, int len); static rc4_t *rc4 = NULL; -void setproctitle(const char *fmt, ...) -{ - /* FIXME */ -} - unsigned int arc4random(void) { unsigned int r; @@ -105,4 +102,11 @@ void get_random_bytes(unsigned char *buf, int len) exit(1); } } +#endif /* !HAVE_ARC4RANDOM */ +#ifndef HAVE_SETPROCTITLE +void setproctitle(const char *fmt, ...) +{ + /* FIXME */ +} +#endif /* !HAVE_SETPROCTITLE */ diff --git a/helper.h b/helper.h index 309156a2c..0e53fac43 100644 --- a/helper.h +++ b/helper.h @@ -36,8 +36,15 @@ #ifndef _HELPER_H #define _HELPER_H +#include "config.h" + +#ifndef HAVE_ARC4RANDOM unsigned int arc4random(void); void arc4random_stir(void); +#endif /* !HAVE_ARC4RANDOM */ + +#ifndef HAVE_SETPROCTITLE void setproctitle(const char *fmt, ...); +#endif /* !HAVE_SETPROCTITLE */ #endif /* _HELPER_H */ diff --git a/mktemp.c b/mktemp.c index 69dc4dc6f..de11a6b53 100644 --- a/mktemp.c +++ b/mktemp.c @@ -47,8 +47,11 @@ static char rcsid[] = "$OpenBSD: mktemp.c,v 1.13 1998/06/30 23:03:13 deraadt Exp #include #include +#include "config.h" #include "helper.h" +#ifndef HAVE_MKDTEMP + static int _gettemp __P((char *, int *, int, int)); int @@ -181,3 +184,5 @@ _gettemp(path, doopen, domkdir, slen) } /*NOTREACHED*/ } + +#endif /* !HAVE_MKDTEMP */ diff --git a/mktemp.h b/mktemp.h index 5d380058e..ac92cbae0 100644 --- a/mktemp.h +++ b/mktemp.h @@ -1,7 +1,11 @@ #ifndef _MKTEMP_H #define _MKTEMP_H + +#include "config.h" +#ifndef HAVE_MKDTEMP int mkstemps(char *path, int slen); int mkstemp(char *path); char *mkdtemp(char *path); +#endif /* !HAVE_MKDTEMP */ #endif /* _MKTEMP_H */ diff --git a/rc4.c b/rc4.c index a426188aa..998a10774 100644 --- a/rc4.c +++ b/rc4.c @@ -41,6 +41,9 @@ /* $Id: rc4.c,v 1.1.1.1 1999/10/26 05:48:13 damien Exp $ */ +#include "config.h" + +#ifndef HAVE_ARC4RANDOM #include "rc4.h" @@ -103,3 +106,4 @@ void rc4_getbytes(rc4_t *r, unsigned char *buffer, int len) c++; } } +#endif /* !HAVE_ARC4RANDOM */ diff --git a/rc4.h b/rc4.h index 904affec3..1be64acac 100644 --- a/rc4.h +++ b/rc4.h @@ -44,6 +44,9 @@ #ifndef _RC4_H #define _RC4_H +#include "config.h" +#ifndef HAVE_ARC4RANDOM + /*! \struct rc4_t \brief RC4 stream cipher state object \var s State array @@ -107,4 +110,6 @@ void rc4_crypt(rc4_t *r, unsigned char *plaintext, int len); */ void rc4_getbytes(rc4_t *r, unsigned char *buffer, int len); +#endif /* !HAVE_ARC4RANDOM */ + #endif /* _RC4_H */ diff --git a/strlcpy.c b/strlcpy.c index 300a28bc3..4df4080d6 100644 --- a/strlcpy.c +++ b/strlcpy.c @@ -34,6 +34,9 @@ static char *rcsid = "$OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp #include #include +#include "config.h" +#ifndef HAVE_STRLCPY + /* * Copy src to string dst of size siz. At most siz-1 characters * will be copied. Always NUL terminates (unless siz == 0). @@ -66,3 +69,5 @@ size_t strlcpy(dst, src, siz) return(s - src - 1); /* count does not include NUL */ } + +#endif /* !HAVE_STRLCPY */ diff --git a/strlcpy.h b/strlcpy.h index 824df300c..9afbd39c5 100644 --- a/strlcpy.h +++ b/strlcpy.h @@ -1,4 +1,9 @@ #ifndef _STRLCPY_H #define _STRLCPY_H + +#include "config.h" +#ifndef HAVE_STRLCPY size_t strlcpy(char *dst, const char *src, size_t siz); +#endif /* !HAVE_STRLCPY */ + #endif /* _STRLCPY_H */