diff --git a/lib/roken/roken.h b/lib/roken/roken.h index 7ba4e9d01..dd2abb653 100644 --- a/lib/roken/roken.h +++ b/lib/roken/roken.h @@ -132,9 +132,11 @@ int getent(char *cp, char *name); char *getstr(char *id, char **cpp); #endif +#ifdef HAVE_PWD_H #include struct passwd *k_getpwnam (char *user); struct passwd *k_getpwuid (uid_t uid); +#endif #ifndef HAVE_SETEUID int seteuid(int euid); @@ -144,6 +146,13 @@ int seteuid(int euid); int setegid(int egid); #endif +#ifndef HAVE_STRCHR && defined(HAVE_INDEX) +#define strchr(p, ch) index(p, ch) +#endif +#ifndef HAVE_STRRCHR && defined(HAVE_RINDEX) +#define strrchr(p, ch) rindex(p, ch) +#endif + #include #include time_t tm2time (struct tm tm, int local); diff --git a/lib/roken/roken.h.in b/lib/roken/roken.h.in index 7ba4e9d01..dd2abb653 100644 --- a/lib/roken/roken.h.in +++ b/lib/roken/roken.h.in @@ -132,9 +132,11 @@ int getent(char *cp, char *name); char *getstr(char *id, char **cpp); #endif +#ifdef HAVE_PWD_H #include struct passwd *k_getpwnam (char *user); struct passwd *k_getpwuid (uid_t uid); +#endif #ifndef HAVE_SETEUID int seteuid(int euid); @@ -144,6 +146,13 @@ int seteuid(int euid); int setegid(int egid); #endif +#ifndef HAVE_STRCHR && defined(HAVE_INDEX) +#define strchr(p, ch) index(p, ch) +#endif +#ifndef HAVE_STRRCHR && defined(HAVE_RINDEX) +#define strrchr(p, ch) rindex(p, ch) +#endif + #include #include time_t tm2time (struct tm tm, int local);