From 7b0737a48ca16e342eec6f5dc26a2068a6dd8ebb Mon Sep 17 00:00:00 2001 From: tim Date: Fri, 12 Apr 2002 03:35:39 +0000 Subject: [PATCH] [acconfig.h defines.h includes.h] put includes in includes.h and defines in defines.h [rijndael.c openbsd-compat/fake-socket.h openbsd-compat/inet_aton.c] include "includes.h" instead of "config.h" ok stevesk@ --- ChangeLog | 4 ++ acconfig.h | 2 - defines.h | 92 ++++------------------------ includes.h | 114 ++++++++++++++++++++++++++--------- openbsd-compat/fake-socket.h | 2 +- openbsd-compat/inet_aton.c | 2 +- rijndael.c | 2 +- 7 files changed, 103 insertions(+), 115 deletions(-) diff --git a/ChangeLog b/ChangeLog index e839281b..b3fd3faf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 20020411 - (stevesk) [auth-sia.c] cleanup + - (tim) [acconfig.h defines.h includes.h] put includes in includes.h and + defines in defines.h [rijndael.c openbsd-compat/fake-socket.h + openbsd-compat/inet_aton.c] include "includes.h" instead of "config.h" + ok stevesk@ 20020410 - (stevesk) [configure.ac monitor.c] HAVE_SOCKETPAIR diff --git a/acconfig.h b/acconfig.h index 541e7886..b7bb1c40 100644 --- a/acconfig.h +++ b/acconfig.h @@ -344,6 +344,4 @@ /* ******************* Shouldn't need to edit below this line ************** */ -#include "defines.h" - #endif /* _CONFIG_H */ diff --git a/defines.h b/defines.h index cb2c9458..52f6c2e8 100644 --- a/defines.h +++ b/defines.h @@ -3,61 +3,6 @@ /* $Id$ */ -/* Necessary headers */ - -#include /* For [u]intxx_t */ -#include /* For SHUT_XXXX */ -#include /* For MAXPATHLEN and roundup() */ -#include /* For typedefs */ -#include /* For IPv6 macros */ -#include /* For IPTOS macros */ -#ifdef HAVE_RPC_TYPES_H -# include /* For INADDR_LOOPBACK */ -#endif -#ifdef HAVE_SYS_UN_H -# include /* For sockaddr_un */ -#endif -#ifdef HAVE_SYS_BITYPES_H -# include /* For u_intXX_t */ -#endif -#ifdef HAVE_PATHS_H -# include /* For _PATH_XXX */ -#endif -#ifdef HAVE_LIMITS_H -# include /* For PATH_MAX */ -#endif -#ifdef HAVE_SYS_TIME_H -# include /* For timersub */ -#endif -#ifdef HAVE_MAILLOCK_H -# include /* For _PATH_MAILDIR */ -#endif -#ifdef HAVE_SYS_CDEFS_H -# include /* For __P() */ -#endif -#ifdef HAVE_SYS_SYSMACROS_H -# include /* For MIN, MAX, etc */ -#endif -#ifdef HAVE_SYS_STAT_H -# include /* For S_* constants and macros */ -#endif -#ifdef HAVE_NEXT -# include -#endif - -#include /* For STDIN_FILENO, etc */ -#include /* Struct winsize */ -#include /* For O_NONBLOCK */ -#include /* For OPENSSL_VERSION_NUMBER */ - -/* *-*-nto-qnx needs these headers for strcasecmp and LASTLOG_FILE respectively */ -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_LOGIN_H -# include -#endif - /* Constants */ @@ -139,6 +84,14 @@ enum # define S_IRWXO 0000007 /* read, write, execute */ #endif /* S_IXUSR */ +#if !defined(MAP_ANON) && defined(MAP_ANONYMOUS) +#define MAP_ANON MAP_ANONYMOUS +#endif + +#ifndef MAP_FAILED +# define MAP_FAILED ((void *)-1) +#endif + /* *-*-nto-qnx doesn't define this constant in the system headers */ #ifdef MISSING_NFDBITS # define NFDBITS (8 * sizeof(unsigned long)) @@ -440,10 +393,6 @@ struct winsize { # define howmany(x,y) (((x)+((y)-1))/(y)) #endif -#ifdef __hpux -#define MAP_ANON MAP_ANONYMOUS -#endif - #ifndef ALIGNBYTES #define ALIGNBYTES (sizeof(int) - 1) #endif @@ -466,6 +415,10 @@ struct winsize { /* Function replacement / compatibility hacks */ +#ifndef HAVE_GETOPT_OPTRESET +#define getopt(ac, av, o) BSDgetopt(ac, av, o) +#endif + /* In older versions of libpam, pam_strerror takes a single argument */ #ifdef HAVE_OLD_PAM # define PAM_STRERROR(a,b) pam_strerror((b)) @@ -525,27 +478,6 @@ struct winsize { ** login recorder definitions **/ -/* preprocess */ - -#ifdef HAVE_UTMP_H -# ifdef HAVE_TIME_IN_UTMP -# include -# endif -# include -#endif -#ifdef HAVE_UTMPX_H -# ifdef HAVE_TV_IN_UTMPX -# include -# endif -# include -#endif -#ifdef HAVE_LASTLOG_H -# include -#endif -#ifdef HAVE_PATHS_H -# include -#endif - /* FIXME: put default paths back in */ #ifndef UTMP_FILE # ifdef _PATH_UTMP diff --git a/includes.h b/includes.h index df91404e..a63e8724 100644 --- a/includes.h +++ b/includes.h @@ -21,21 +21,10 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg } #include "config.h" -#include "openbsd-compat/bsd-nextstep.h" - -#include -#include -#include -#include -#include - -#include -#include - #include #include #include -#include +#include /* For O_NONBLOCK */ #include #include #include @@ -46,14 +35,11 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg } #include #ifdef HAVE_LIMITS_H -# include +# include /* For PATH_MAX */ #endif #ifdef HAVE_GETOPT_H # include #endif -#ifndef HAVE_GETOPT_OPTRESET -#define getopt(ac, av, o) BSDgetopt(ac, av, o) -#endif #ifdef HAVE_BSTRING_H # include #endif @@ -70,34 +56,102 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg } #ifdef HAVE_ENDIAN_H # include #endif -#ifdef HAVE_SYS_SELECT_H -# include +#ifdef HAVE_TTYENT_H +# include +#endif +#ifdef HAVE_UTIME_H +# include +#endif +#ifdef HAVE_MAILLOCK_H +# include /* For _PATH_MAILDIR */ +#endif +#ifdef HAVE_NEXT +# include +#endif +#include /* For STDIN_FILENO, etc */ +#include /* Struct winsize */ + +/* + *-*-nto-qnx needs these headers for strcasecmp and LASTLOG_FILE respectively + */ +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_LOGIN_H +# include +#endif + +#ifdef HAVE_UTMP_H +# include +#endif +#ifdef HAVE_UTMPX_H +# ifdef HAVE_TV_IN_UTMPX +# include +# endif +# include +#endif +#ifdef HAVE_LASTLOG_H +# include +#endif +#ifdef HAVE_PATHS_H +# include /* For _PATH_XXX */ #endif + +#include +#include +#include +#include #ifdef HAVE_SYS_TIME_H -# include +# include /* For timersub */ +#endif +#include +#ifdef HAVE_SYS_SELECT_H +# include #endif #ifdef HAVE_SYS_BSDTTY_H # include #endif -#ifdef HAVE_TTYENT_H -# include +#include /* For MAXPATHLEN and roundup() */ +#ifdef HAVE_SYS_UN_H +# include /* For sockaddr_un */ #endif -#ifdef USE_PAM -# include +#ifdef HAVE_SYS_BITYPES_H +# include /* For u_intXX_t */ +#endif +#ifdef HAVE_SYS_CDEFS_H +# include /* For __P() */ +#endif +#ifdef HAVE_SYS_STAT_H +# include /* For S_* constants and macros */ #endif #ifdef HAVE_SYS_SYSMACROS_H -# include +# include /* For MIN, MAX, etc */ #endif -#ifdef HAVE_UTIME_H -# include +#ifdef HAVE_SYS_MMAN_H +#include /* for MAP_ANONYMOUS */ +#endif + +#include /* For typedefs */ +#include /* For IPv6 macros */ +#include /* For IPTOS macros */ +#include +#include +#ifdef HAVE_RPC_TYPES_H +# include /* For INADDR_LOOPBACK */ +#endif +#ifdef USE_PAM +# include #endif + +#include /* For OPENSSL_VERSION_NUMBER */ + +#include "defines.h" + #include "version.h" #include "openbsd-compat/openbsd-compat.h" #include "openbsd-compat/bsd-cygwin_util.h" -#include "entropy.h" +#include "openbsd-compat/bsd-nextstep.h" -#ifndef MAP_FAILED -# define MAP_FAILED ((void *)-1) -#endif +#include "entropy.h" #endif /* INCLUDES_H */ diff --git a/openbsd-compat/fake-socket.h b/openbsd-compat/fake-socket.h index 79f8ed4f..540cfead 100644 --- a/openbsd-compat/fake-socket.h +++ b/openbsd-compat/fake-socket.h @@ -3,7 +3,7 @@ #ifndef _FAKE_SOCKET_H #define _FAKE_SOCKET_H -#include "config.h" +#include "includes.h" #include "sys/types.h" #ifndef HAVE_STRUCT_SOCKADDR_STORAGE diff --git a/openbsd-compat/inet_aton.c b/openbsd-compat/inet_aton.c index 18e31e7f..1fc001da 100644 --- a/openbsd-compat/inet_aton.c +++ b/openbsd-compat/inet_aton.c @@ -55,7 +55,7 @@ * --Copyright-- */ -#include "config.h" +#include "includes.h" #if !defined(HAVE_INET_ATON) diff --git a/rijndael.c b/rijndael.c index c8ba55e7..448048ea 100644 --- a/rijndael.c +++ b/rijndael.c @@ -25,7 +25,7 @@ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "config.h" +#include "includes.h" #include #include -- 2.45.2