From 39c92a3f70bb15003540ed5ab277db893a1c707e Mon Sep 17 00:00:00 2001 From: rofl0r Date: Wed, 21 Dec 2016 20:45:03 +0000 Subject: configure: do not check for standard C headers addresses #65 --- src/common.h | 38 ++++++++++++++------------------------ 1 file changed, 14 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/common.h b/src/common.h index 89a054f..7f5ce9b 100644 --- a/src/common.h +++ b/src/common.h @@ -32,6 +32,16 @@ /* * Include standard headers which are used through-out tinyproxy */ + +/* standard C headers - we can safely assume they exist. */ +#include +#include +#include +#include +#include +#include +#include + #ifdef HAVE_SYS_TYPES_H # include #endif @@ -41,12 +51,6 @@ #ifdef HAVE_INTTYPES_H # include #endif -#ifdef HAVE_STDDEF_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif #ifdef HAVE_SYS_IOCTL_H # include @@ -97,9 +101,6 @@ #ifdef HAVE_ASSERT_H # include #endif -#ifdef HAVE_CTYPE_H -# include -#endif #ifdef HAVE_ERRNO_H # include #endif @@ -127,19 +128,11 @@ #ifdef HAVE_STDARG_H # include #endif -#ifdef HAVE_STDIO_H -# include -#endif -#ifdef HAVE_STDLIB_H -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# include + +#ifdef HAVE_MALLOC_H +# include #endif + #ifdef HAVE_STRINGS_H # include #endif @@ -149,9 +142,6 @@ #ifdef HAVE_SYSLOG_H # include #endif -#ifdef HAVE_UNISTD_H -# include -#endif #ifdef HAVE_WCHAR_H # include #endif -- cgit v1.2.3 From 81a93f9e4fc4a6f134749ea077b797687a12abf9 Mon Sep 17 00:00:00 2001 From: rofl0r Date: Wed, 21 Dec 2016 20:58:20 +0000 Subject: configure: do not check for standard POSIX headers addresses #65 --- configure.ac | 15 +------- src/common.h | 119 ++++++++++++++++------------------------------------------- src/log.h | 11 +----- 3 files changed, 33 insertions(+), 112 deletions(-) (limited to 'src') diff --git a/configure.ac b/configure.ac index 3161620..e148077 100644 --- a/configure.ac +++ b/configure.ac @@ -161,22 +161,9 @@ dnl AC_HEADER_STDC AC_HEADER_TIME AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS([sys/ioctl.h sys/mman.h sys/resource.h \ - sys/select.h sys/socket.h sys/time.h sys/uio.h \ - sys/un.h arpa/inet.h netinet/in.h \ - assert.h errno.h fcntl.h grp.h io.h libintl.h \ - netdb.h pwd.h regex.h signal.h stdarg.h \ - sysexits.h syslog.h time.h wchar.h wctype.h \ +AC_CHECK_HEADERS([sys/ioctl.h alloca.h memory.h malloc.h sysexits.h \ values.h]) -dnl OpenBSD machines don't like having malloc included (even if it's present) -dnl as they expect you to use stdlib.h -case "$target" in - *-openbsd*) ;; - *) AC_CHECK_HEADER(malloc.h);; -esac - - dnl Checks for types AC_TYPE_SIZE_T AC_TYPE_PID_T diff --git a/src/common.h b/src/common.h index 7f5ce9b..47a1ed1 100644 --- a/src/common.h +++ b/src/common.h @@ -41,115 +41,58 @@ #include #include #include - -#ifdef HAVE_SYS_TYPES_H +/* standard POSIX headers - they need to be there as well. */ +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include # include -#endif +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include + +/* rest - some oddball headers */ #ifdef HAVE_VALUES_H # include #endif -#ifdef HAVE_INTTYPES_H -# include -#endif #ifdef HAVE_SYS_IOCTL_H # include #endif -#ifdef HAVE_SYS_SELECT_H -# include -#endif -#ifdef HAVE_SYS_SOCKET_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef TIME_WITH_SYS_TIME -# include -# include -#else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif - -#ifdef HAVE_SYS_RESOURCE_H -# include -#endif -#ifdef HAVE_SYS_UIO_H -# include -#endif -#ifdef HAVE_SYS_UN_H -# include -#endif -#ifdef HAVE_SYS_WAIT_H -# include -#endif - -#ifdef HAVE_NETINET_IN_H -# include -#endif -#ifdef HAVE_ARPA_INET_H -# include -#endif #ifdef HAVE_ALLOCA_H # include #endif -#ifdef HAVE_ASSERT_H -# include -#endif -#ifdef HAVE_ERRNO_H -# include -#endif -#ifdef HAVE_FCNTL_H -# include -#endif -#ifdef HAVE_GRP_H -# include -#endif + #ifdef HAVE_MEMORY_H # include #endif -#ifdef HAVE_NETDB_H -# include -#endif -#ifdef HAVE_PWD_H -# include -#endif -#ifdef HAVE_REGEX_H -# include -#endif -#ifdef HAVE_SIGNAL_H -# include -#endif -#ifdef HAVE_STDARG_H -# include -#endif #ifdef HAVE_MALLOC_H # include #endif -#ifdef HAVE_STRINGS_H -# include -#endif #ifdef HAVE_SYSEXITS_H -# include -#endif -#ifdef HAVE_SYSLOG_H -# include -#endif -#ifdef HAVE_WCHAR_H -# include -#endif -#ifdef HAVE_WCTYPE_H -# include -#endif -#ifdef HAVE_SYS_MMAN_H -# include +# include #endif /* diff --git a/src/log.h b/src/log.h index b523ab0..68c89c3 100644 --- a/src/log.h +++ b/src/log.h @@ -77,16 +77,7 @@ * don't advocate this, but it could be useful at times.) */ -#ifdef HAVE_SYSLOG_H -# include -#else -# define LOG_CRIT 2 -# define LOG_ERR 3 -# define LOG_WARNING 4 -# define LOG_NOTICE 5 -# define LOG_INFO 6 -# define LOG_DEBUG 7 -#endif +#include #define LOG_CONN 8 /* extra to log connections without the INFO stuff */ -- cgit v1.2.3