]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
configure: Create a definition for UOFF_T_MAX.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Fri, 6 Apr 2018 23:00:46 +0000 (01:00 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Sat, 12 May 2018 07:50:29 +0000 (07:50 +0000)
configure.ac
m4/uoff_t_max.m4 [new file with mode: 0644]

index 46ea4bcfd7ee560c229c46bdae1de8253680838a..59e2381fb80f08bf850a5c0bda76fe52b53c2f3b 100644 (file)
@@ -391,6 +391,7 @@ AC_TYPEOF(off_t, long int long-long)
 case "$typeof_off_t" in
   int)
     offt_max=INT_MAX
+    uofft_max=UINT_MAX
     uofft_fmt="u"
     if test "$have_uoff_t" != "yes"; then
       AC_DEFINE(UOFF_T_INT,, [Define if off_t is int])
@@ -399,6 +400,7 @@ case "$typeof_off_t" in
     ;;
   long)
     offt_max=LONG_MAX
+    uofft_max=ULONG_MAX
     uofft_fmt="lu"
     if test "$have_uoff_t" != "yes"; then
       AC_DEFINE(UOFF_T_LONG,, [Define if off_t is long])
@@ -407,6 +409,7 @@ case "$typeof_off_t" in
     ;;
   "long long")
     offt_max=LLONG_MAX
+    uofft_max=ULLONG_MAX
     uofft_fmt="llu"
     if test "$have_uoff_t" != "yes"; then
       AC_DEFINE(UOFF_T_LONG_LONG,, [Define if off_t is long long])
@@ -420,6 +423,7 @@ esac
 
 DOVECOT_DIRENT_DTYPE
 DOVECOT_OFF_T_MAX
+DOVECOT_UOFF_T_MAX
 
 AC_DEFINE_UNQUOTED(PRIuUOFF_T, "$uofft_fmt", [printf() format for uoff_t])
 
diff --git a/m4/uoff_t_max.m4 b/m4/uoff_t_max.m4
new file mode 100644 (file)
index 0000000..78ca4d1
--- /dev/null
@@ -0,0 +1,13 @@
+AC_DEFUN([DOVECOT_UOFF_T_MAX], [
+  dnl * Do we have UOFF_T_MAX?
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+    #include <limits.h>
+    #include <sys/types.h>
+  ]], [[
+    uoff_t i = UOFF_T_MAX;
+  ]])],[
+    :
+  ],[
+    AC_DEFINE_UNQUOTED(UOFF_T_MAX, $uofft_max, [Maximum value of uoff_t])
+  ])
+])