File: ac_compile_check_sizeof.m4

package info (click to toggle)
php-mongodb 1.5.3-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 12,776 kB
  • sloc: ansic: 78,913; xml: 2,277; php: 990; sh: 107; python: 47; pascal: 21; makefile: 2
file content (24 lines) | stat: -rw-r--r-- 793 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
AC_DEFUN([AC_COMPILE_CHECK_SIZEOF],
[
dnl The name to #define.
define(AC_TYPE_NAME, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
dnl The cache variable name.
define(AC_CV_NAME, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
AC_MSG_CHECKING(size of $1)
AC_CACHE_VAL(AC_CV_NAME,
[for ac_size in 4 8 1 2 16 $2 ; do # List sizes in rough order of prevalence.
  AC_TRY_COMPILE([#include "confdefs.h"
#include <sys/types.h>
$2
], [switch (0) case 0: case (sizeof ($1) == $ac_size):;], AC_CV_NAME=$ac_size)
  if test x$AC_CV_NAME != x ; then break; fi
done
])
if test x$AC_CV_NAME = x ; then
  AC_MSG_ERROR([cannot determine a size for $1])
fi
AC_MSG_RESULT($AC_CV_NAME)
AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1])
undefine([AC_TYPE_NAME])dnl
undefine([AC_CV_NAME])dnl
])