diff mbox series

AT&T Unix PC : 09-type-sizes

Message ID 3b5cd0a2-a3da-4013-ad20-f77dbeaa6b72@knaff.lu (mailing list archive)
State New
Headers show
Series AT&T Unix PC : 09-type-sizes | expand

Commit Message

Alain Knaff Nov. 17, 2024, 5:21 p.m. UTC
Hi,

The 9th patch supplies auto-detection of size of various integer and
other types

Regards,

Alain
diff mbox series

Patch

diff -X ../exclude.txt -urN dash-0.5.12+08-vsnprintf/configure.ac dash-0.5.12+09-type-sizes/configure.ac
--- dash-0.5.12+08-vsnprintf/configure.ac	2024-11-10 17:29:04.521055631 +0000
+++ dash-0.5.12+09-type-sizes/configure.ac	2024-11-10 17:06:37.153028629 +0000
@@ -68,17 +68,30 @@ 
 AC_CHECK_DECLS([isblank],,,[#include <ctype.h>])
 
 AC_DECL_SYS_SIGLIST
+AC_TYPE_PID_T
+AC_TYPE_UID_T
+AC_TYPE_SSIZE_T
+AC_TYPE_UINT32_T
+
+AC_CHECK_TYPE([intmax_t],,AC_DEFINE_UNQUOTED([intmax_t],long,[Define intmax_t type, must also be supported by printf]))
+
+AC_CHECK_TYPE([uintmax_t],,AC_DEFINE_UNQUOTED([uintmax_t],unsigned long,[Define uintmax_t type, must also be supported by printf]))
 
 dnl Check for sizes of types
+AC_SYS_LARGEFILE
 AC_CHECK_SIZEOF([intmax_t])
 AC_CHECK_SIZEOF([long long int])
+AC_CHECK_SIZEOF([long int])
 
 dnl Select a fallback format string for intmax_t in case we don't find PRIdMAX
 if test "x$ac_cv_sizeof_intmax_t" = "x$ac_cv_sizeof_long_long_int"; then
   intmax_fstr="lld"
+else if test "x$ac_cv_sizeof_intmax_t" = "x$ac_cv_sizeof_long_int"; then
+  intmax_fstr="ld"
 else
   intmax_fstr="jd"
 fi
+fi
 
 dnl Check for PRIdMAX and define it to a fallback if not found
 AC_CHECK_DECL([PRIdMAX],,