From: Damien Riegel Date: Wed, 19 Apr 2017 17:31:59 +0000 (-0400) Subject: remove stuff defined in POSIX:2001 X-Git-Tag: neomutt-20170526~38^2~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=48498f2a75f1e21b96bf86076df00b6a689e26b6;p=neomutt remove stuff defined in POSIX:2001 Headers: locale.h sys/time.h sys/resource.h sys/select.h Header checks: HAVE_FTRUNCATE HAVE_INTTYPES_H HAVE_ISWBLANK HAVE_LOCALE_H HAVE_SETRLIMIT HAVE_SYS_RESOURCE_H HAVE_SYS_SELECT_H HAVE_SYS_TIME_H Functions: getopt getsid setegid setenv setrlimit strcasecmp strdup strftime strncasecmp strtok_r fseeko Types: pid_t ssize_t socklen_t --- diff --git a/configure.ac b/configure.ac index bd29fdb32..bfa8fccdc 100644 --- a/configure.ac +++ b/configure.ac @@ -52,7 +52,6 @@ AC_CHECK_TOOL(AR, ar, ar) AC_C_BIGENDIAN AC_SYS_LARGEFILE -AC_FUNC_FSEEKO AC_CHECK_SIZEOF(off_t) AC_PATH_PROG(DBX, dbx, no) @@ -96,26 +95,11 @@ AH_TEMPLATE([ICONV_NONTRANS], all return values other than (size_t)(-1) as equivalent.]) AH_BOTTOM([/* fseeko portability defines */ -#ifdef HAVE_FSEEKO -# define LOFF_T off_t -# if HAVE_C99_INTTYPES && HAVE_INTTYPES_H -# if SIZEOF_OFF_T == 8 -# define OFF_T_FMT "%" PRId64 -# else -# define OFF_T_FMT "%" PRId32 -# endif -# else -# if (SIZEOF_OFF_T == 8) && (SIZEOF_LONG == 4) -# define OFF_T_FMT "%lld" -# else -# define OFF_T_FMT "%ld" -# endif -# endif +#define LOFF_T off_t +#if SIZEOF_OFF_T == 8 +# define OFF_T_FMT "%" PRId64 #else -# define LOFF_T long -# define fseeko fseek -# define ftello ftell -# define OFF_T_FMT "%ld" +# define OFF_T_FMT "%" PRId32 #endif ]) @@ -449,11 +433,10 @@ main () AC_HEADER_STDC AC_CHECK_HEADERS(sys/ioctl.h ioctl.h sysexits.h) -AC_CHECK_HEADERS(sys/time.h sys/resource.h sys/syscall.h) +AC_CHECK_HEADERS(sys/syscall.h) -AC_CHECK_FUNCS(setrlimit getsid) AC_CHECK_FUNCS(fgets_unlocked fgetc_unlocked) -AC_CHECK_FUNCS(strcasecmp strncasecmp setenv strdup strsep strtok_r mkdtemp) +AC_CHECK_FUNCS(strsep mkdtemp) AC_MSG_CHECKING(for sig_atomic_t in signal.h) AC_EGREP_HEADER(volatile.*sig_atomic_t,signal.h, @@ -473,30 +456,13 @@ AC_CHECK_DECLS([sys_siglist],[],[],[#include ]) -AC_TYPE_PID_T -AC_CHECK_TYPE(ssize_t, int) - -AC_CHECK_FUNCS(setegid) - AC_REPLACE_FUNCS([wcscasecmp strcasestr]) -AC_CHECK_FUNC(getopt) -if test $ac_cv_func_getopt = yes; then - AC_CHECK_HEADERS(getopt.h) -fi - -dnl SCO uses chsize() instead of ftruncate() -AC_CHECK_FUNCS(ftruncate, , [AC_CHECK_LIB(x, chsize)]) - -dnl SCO has strftime() in libintl -AC_CHECK_FUNCS(strftime, , [AC_CHECK_LIB(intl, strftime)]) +AC_CHECK_HEADERS(getopt.h) dnl Set the atime of files AC_CHECK_FUNCS(futimens) -dnl AIX may not have fchdir() -AC_CHECK_FUNCS(fchdir, , [mutt_cv_fchdir=no]) - AC_ARG_WITH(homespool, AS_HELP_STRING([--with-homespool@<:@=FILE@:>@],[File in user's directory where new mail is spooled]), with_homespool=${withval}) if test x$with_homespool != x; then @@ -664,12 +630,6 @@ fi dnl -- end socket dependencies -- if test "$need_socket" = "yes"; then - AC_CHECK_HEADERS([sys/select.h]) - AC_MSG_CHECKING([for socklen_t]) - AC_EGREP_HEADER(socklen_t, sys/socket.h, AC_MSG_RESULT([yes]), - AC_MSG_RESULT([no]) - AC_DEFINE(socklen_t,int, - [ Define to 'int' if doesn't have it. ])) AC_DEFINE(USE_SOCKET,1, [ Include code for socket support. Set automatically if you enable POP3 or IMAP ]) MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS account.o mutt_socket.o mutt_tunnel.o" @@ -1116,7 +1076,6 @@ dnl -- iconv/gettext -- AM_GNU_GETTEXT_VERSION([0.17]) AM_GNU_GETTEXT([external]) -AC_CHECK_HEADERS([locale.h]) AM_ICONV if test "$am_cv_func_iconv" != yes; then diff --git a/crypt.c b/crypt.c index e8981785e..b4af13ed3 100644 --- a/crypt.c +++ b/crypt.c @@ -23,9 +23,12 @@ #include "config.h" #include #include +#include #include #include +#include #include +#include #include #include #include "mutt.h" @@ -33,15 +36,6 @@ #include "mime.h" #include "mutt_crypt.h" #include "mutt_curses.h" -#ifdef HAVE_LOCALE_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_SYS_RESOURCE_H -#include -#endif /* print the current time to avoid spoofing of the signature output */ @@ -79,7 +73,7 @@ void crypt_forget_passphrase(void) } -#if defined(HAVE_SETRLIMIT) && (!defined(DEBUG)) +#if (!defined(DEBUG)) static void disable_coredumps(void) { @@ -93,14 +87,14 @@ static void disable_coredumps(void) } } -#endif /* HAVE_SETRLIMIT */ +#endif int crypt_valid_passphrase(int flags) { int ret = 0; -#if defined(HAVE_SETRLIMIT) && (!defined(DEBUG)) +#if !defined(DEBUG) disable_coredumps(); #endif diff --git a/crypt_gpgme.c b/crypt_gpgme.c index 9ae33cfcf..70d702cfb 100644 --- a/crypt_gpgme.c +++ b/crypt_gpgme.c @@ -27,9 +27,12 @@ #include #include #include +#include #include #include +#include #include +#include #include #include #include "mutt.h" @@ -40,15 +43,6 @@ #include "mutt_menu.h" #include "pager.h" #include "sort.h" -#ifdef HAVE_LOCALE_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_SYS_RESOURCE_H -#include -#endif #define PKA_NOTATION_NAME "pka-address@gnupg.org" #define is_pka_notation(notation) \ diff --git a/curs_lib.c b/curs_lib.c index 2576c5683..0ef72c6bd 100644 --- a/curs_lib.c +++ b/curs_lib.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -32,9 +33,6 @@ #include "mutt_curses.h" #include "mutt_menu.h" #include "pager.h" -#ifdef HAVE_SYS_TIME_H -#include -#endif #ifdef HAVE_ISWBLANK #include #endif @@ -313,15 +311,12 @@ int mutt_yesorno(const char *msg, int def) } answer[0] = ch.ch; - if (reyes_ok ? (regexec(&reyes, answer, 0, 0, 0) == 0) : - (tolower(ch.ch) == 'y')) + if (reyes_ok ? (regexec(&reyes, answer, 0, 0, 0) == 0) : (tolower(ch.ch) == 'y')) { def = MUTT_YES; break; } - else if ( - reno_ok ? (regexec(&reno, answer, 0, 0, 0) == 0) : - (tolower(ch.ch) == 'n')) + else if (reno_ok ? (regexec(&reno, answer, 0, 0, 0) == 0) : (tolower(ch.ch) == 'n')) { def = MUTT_NO; break; diff --git a/hcache.c b/hcache.c index d6af01654..508331178 100644 --- a/hcache.c +++ b/hcache.c @@ -26,13 +26,11 @@ #endif #include +#include #include "hcache.h" #include "hcache_backend.h" #include "hcversion.h" #include "md5.h" -#ifdef HAVE_SYS_TIME_H -#include -#endif static unsigned int hcachever = 0x0; diff --git a/mh.c b/mh.c index 25e6aaf6b..f26e16857 100644 --- a/mh.c +++ b/mh.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -42,9 +43,6 @@ #include "mutt_curses.h" #include "mx.h" #include "sort.h" -#ifdef HAVE_SYS_TIME_H -#include -#endif #ifdef USE_NOTMUCH #include "mutt_notmuch.h" #endif diff --git a/mutt_socket.c b/mutt_socket.c index be9b28755..92897352d 100644 --- a/mutt_socket.c +++ b/mutt_socket.c @@ -25,15 +25,13 @@ #include #include #include +#include #include #include #include "mutt.h" -#include "mutt_socket.h" #include "mutt_idna.h" +#include "mutt_socket.h" #include "mutt_tunnel.h" -#ifdef HAVE_SYS_TIME_H -#include -#endif #ifdef HAVE_SYS_SELECT_H #include #endif diff --git a/pgp.c b/pgp.c index 95c3987a3..9924a6901 100644 --- a/pgp.c +++ b/pgp.c @@ -28,9 +28,12 @@ #include "config.h" #include #include +#include #include #include +#include #include +#include #include #include #include "mutt.h" @@ -39,18 +42,8 @@ #include "filter.h" #include "mime.h" #include "mutt_crypt.h" -#include "mutt_crypt.h" #include "mutt_curses.h" #include "mutt_menu.h" -#ifdef HAVE_LOCALE_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_SYS_RESOURCE_H -#include -#endif char PgpPass[LONG_STRING]; diff --git a/protos.h b/protos.h index 66a9b058b..dc9ecca71 100644 --- a/protos.h +++ b/protos.h @@ -450,11 +450,6 @@ int getdnsdomainname(char *, size_t); #define SCO #endif -/* SCO Unix uses chsize() instead of ftruncate() */ -#ifndef HAVE_FTRUNCATE -#define ftruncate chsize -#endif - #ifdef _AIX int setegid(gid_t); #endif /* _AIX */ diff --git a/smime.c b/smime.c index 67c8e08e0..66ad74be3 100644 --- a/smime.c +++ b/smime.c @@ -20,9 +20,11 @@ #include "config.h" #include #include +#include #include #include #include +#include #include #include #include "mutt.h" @@ -33,15 +35,6 @@ #include "mutt_crypt.h" #include "mutt_curses.h" #include "mutt_menu.h" -#ifdef HAVE_LOCALE_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_SYS_RESOURCE_H -#include -#endif struct smime_command_context {