From: Karl Fleischmann Date: Fri, 3 Jun 2022 13:56:11 +0000 (+0200) Subject: lib/compat.h: Remove shim of C99 integer datatypes X-Git-Tag: 2.4.0~3829 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c0cc498aba63dfe12fd5cbe9c176ea304bf441a;p=thirdparty%2Fdovecot%2Fcore.git lib/compat.h: Remove shim of C99 integer datatypes The base system is now required to be compatible with C99 and thus the manual check/re-definition of the necessary integer types can be dropped. --- diff --git a/configure.ac b/configure.ac index 84974916b5..3ea7662009 100644 --- a/configure.ac +++ b/configure.ac @@ -403,23 +403,6 @@ AC_DEFINE_UNQUOTED(SSIZE_T_MAX, $ssizet_max, [Maximum value of ssize_t]) dnl we require inttypes.h for PRIu{8,16,32,64} macros AC_CHECK_HEADER(inttypes.h,,AC_MSG_ERROR([inttypes.h missing but required])) -dnl some systems don't have stdint.h, but still have some of the types -dnl defined elsewhere -AC_CHECK_HEADER(stdint.h, [ - stdint_include="#include " -]) - -AC_CHECKTYPE2(uintmax_t, [$stdint_include]) -if test $i_cv_type_uintmax_t = yes; then - AC_DEFINE(HAVE_UINTMAX_T,, [Define if you have uintmax_t (C99 type)]) -fi - -dnl use separate check, eg. Solaris 8 has uintmax_t but not uint_fast32_t -AC_CHECKTYPE2(uint_fast32_t, [$stdint_include]) -if test $i_cv_type_uint_fast32_t = yes; then - AC_DEFINE(HAVE_UINT_FAST32_T,, [Define if you have uint_fast32_t (C99 type)]) -fi - AC_CHECKTYPE2(socklen_t, [#include ]) if test $i_cv_type_socklen_t = yes; then AC_DEFINE(HAVE_SOCKLEN_T,, [Define to 'int' if you don't have socklen_t]) diff --git a/src/lib/compat.h b/src/lib/compat.h index 3542a9b18a..eaa90c34e0 100644 --- a/src/lib/compat.h +++ b/src/lib/compat.h @@ -72,22 +72,6 @@ typedef unsigned long long uoff_t; # error uoff_t size not set #endif -#ifndef HAVE_UINTMAX_T -# if SIZEOF_LONG_LONG > 0 -typedef unsigned long long uintmax_t; -# else -typedef unsigned long uintmax_t; -# endif -#endif - -#ifndef HAVE_UINT_FAST32_T -# if SIZEOF_INT >= 4 -typedef unsigned int uint_fast32_t; -# else -typedef unsigned long uint_fast32_t; -# endif -#endif - #ifndef HAVE_SOCKLEN_T typedef int socklen_t; #endif diff --git a/src/lib/lib.h b/src/lib/lib.h index 10162b887e..a41f0ff298 100644 --- a/src/lib/lib.h +++ b/src/lib/lib.h @@ -17,11 +17,8 @@ #include /* INT_MAX, etc. */ #include /* error checking is good */ #include /* many other includes want this */ +#include /* C99 int types, we mostly need uintmax_t */ #include /* PRI* macros */ - -#ifdef HAVE_STDINT_H -# include /* C99 int types, we mostly need uintmax_t */ -#endif #ifndef __cplusplus # include #endif