diff --git a/lib/roken/hstrerror.c b/lib/roken/hstrerror.c index 0a2b0a9d8..08d7d0862 100644 --- a/lib/roken/hstrerror.c +++ b/lib/roken/hstrerror.c @@ -60,7 +60,7 @@ const int h_nerr = { sizeof h_errlist / sizeof h_errlist[0] }; #else -#ifndef HAVE_H_ERRLIST_DECLARATION +#if !HAVE_DECL_H_ERRLIST extern const char *h_errlist[]; extern int h_nerr; #endif diff --git a/lib/roken/roken.h.in b/lib/roken/roken.h.in index caf1c852c..5e9a82292 100644 --- a/lib/roken/roken.h.in +++ b/lib/roken/roken.h.in @@ -262,7 +262,7 @@ const char *hstrerror(int herr); #endif #endif -#ifndef HAVE_H_ERRNO_DECLARATION +#if !HAVE_DECL_H_ERRNO extern int h_errno; #endif @@ -427,21 +427,17 @@ int get_window_size(int fd, struct winsize *); void vsyslog(int pri, const char *fmt, va_list ap); #endif -#ifndef HAVE_OPTARG_DECLARATION +#if !HAVE_DECL_OPTARG extern char *optarg; #endif -#ifndef HAVE_OPTIND_DECLARATION +#if !HAVE_DECL_OPTIND extern int optind; #endif -#ifndef HAVE_OPTERR_DECLARATION +#if !HAVE_DECL_OPTERR extern int opterr; #endif -#ifndef HAVE___PROGNAME_DECLARATION -extern const char *__progname; -#endif - -#ifndef HAVE_ENVIRON_DECLARATION +#if !HAVE_DECL_ENVIRON extern char **environ; #endif @@ -633,6 +629,10 @@ void setprogname(const char *argv0); const char *getprogname(void); #endif +#if !defined(HAVE_SETPROGNAME) && !defined(HAVE_GETPROGNAME) && !HAVE_DECL___PROGNAME +extern const char *__progname; +#endif + void mini_inetd_addrinfo (struct addrinfo*); void mini_inetd (int port);