File: size_t_signed.m4

package info (click to toggle)
dovecot 1%3A2.4.1%2Bdfsg1-6
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 46,224 kB
  • sloc: ansic: 596,204; makefile: 7,825; sh: 6,005; cpp: 1,866; perl: 487; yacc: 412; lex: 320; python: 253; xml: 232
file content (26 lines) | stat: -rw-r--r-- 839 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
AC_DEFUN([DOVECOT_SIZE_T_SIGNED], [
  dnl Note: we check size_t rather than ssize_t here, because on OSX 10.2
  dnl ssize_t = int and size_t = unsigned long. We're mostly concerned about
  dnl printf format here, so check the size_t one.
  AC_TYPEOF(size_t, unsigned-int unsigned-long unsigned-long-long)
  case "$typeof_size_t" in
    "unsigned long")
      ssizet_max=LONG_MAX
      sizet_fmt="lu"
      ;;
    "unsigned long long")
      ssizet_max=LLONG_MAX
      sizet_fmt="llu"
      ;;
    *)
      dnl older systems didn't have ssize_t, default to int
      ssizet_max=INT_MAX
      sizet_fmt="u"
  
      if test "$typeof_size_t" = ""; then
        AC_DEFINE(size_t, unsigned int, [Define to 'unsigned int' if you don't have it])
        AC_DEFINE(ssize_t, int, [Define to 'int' if you don't have it])
      fi
      ;;
  esac
])