# HG changeset patch # User Josef 'Jeff' Sipek # Date 1495006503 -10800 # Node ID b50c55023f082a20efab0376da0742a57cfb307f # Parent 3970c1d61616e3019025bf5c9fcd81c03d8ca79c lib: include inttypes.h to get PRIu64 & friends Including it in lib.h allows all of the Dovecot code (as well as any external plugins) to just use these macros without worrying about what system headers to include. diff -r 3970c1d61616 -r b50c55023f08 configure.ac --- a/configure.ac Sat Nov 04 14:33:52 2017 +0200 +++ b/configure.ac Wed May 17 10:35:03 2017 +0300 @@ -328,7 +328,7 @@ AC_DEFINE([DOVECOT_VERSION_MAJOR], regexp(AC_PACKAGE_VERSION, [^\([0-9]+\)\.\([0-9]+\)], [\1]), [Dovecot major version]) AC_DEFINE([DOVECOT_VERSION_MINOR], regexp(AC_PACKAGE_VERSION, [^\([0-9]+\)\.\([0-9]+\)], [\2]), [Dovecot minor version]) -AC_CHECK_HEADERS(strings.h stdint.h unistd.h dirent.h malloc.h inttypes.h \ +AC_CHECK_HEADERS(strings.h stdint.h unistd.h dirent.h malloc.h \ sys/uio.h sys/sysmacros.h sys/resource.h sys/select.h libgen.h \ sys/quota.h sys/fs/ufs_quota.h ufs/ufs/quota.h jfs/quota.h \ quota.h sys/fs/quota_common.h \ @@ -898,6 +898,8 @@ $2]], [[$1 t;]])],[i_cv_type_$1=yes],[i_cv_type_$1=no])]) AC_MSG_RESULT($i_cv_type_$1) ]) +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 diff -r 3970c1d61616 -r b50c55023f08 src/lib/compat.h --- a/src/lib/compat.h Sat Nov 04 14:33:52 2017 +0200 +++ b/src/lib/compat.h Wed May 17 10:35:03 2017 +0300 @@ -1,10 +1,6 @@ #ifndef COMPAT_H #define COMPAT_H -#if defined (HAVE_INTTYPES_H) && (defined(__osf__) || defined(_HPUX_SOURCE)) -# include -#endif - /* well, this is obviously wrong since it assumes it's 64bit, but older GCCs don't define it and we really want it. */ #ifndef LLONG_MAX diff -r 3970c1d61616 -r b50c55023f08 src/lib/lib.h --- a/src/lib/lib.h Sat Nov 04 14:33:52 2017 +0200 +++ b/src/lib/lib.h Wed May 17 10:35:03 2017 +0300 @@ -17,6 +17,7 @@ #include /* INT_MAX, etc. */ #include /* error checking is good */ #include /* many other includes want this */ +#include /* PRI* macros */ #ifdef HAVE_STDINT_H # include /* C99 int types, we mostly need uintmax_t */