Debian Codegraph @

cf/have-struct-field.m4

raw ◀ ▶
1 Debian patch touch this file
1 dnl $Id$
2 dnl
3 dnl check for fields in a structure
4 dnl
5 dnl AC_HAVE_STRUCT_FIELD(struct, field, headers)
6
7 AC_DEFUN([AC_HAVE_STRUCT_FIELD], [
8 define(cache_val, translit(ac_cv_type_$1_$2, [A-Z ], [a-z_]))
9 AC_CACHE_CHECK([for $2 in $1], cache_val,[
•10 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <string.h>
11 $3]],
12 [[$1 x; memset(&x, 0, sizeof(x)); x.$2]])],
13 [cache_val=yes],
14 [cache_val=no])
15 ])
16 if test "$cache_val" = yes; then
17 define(foo, translit(HAVE_$1_$2, [a-z ], [A-Z_]))
18 AC_DEFINE(foo, 1, [Define if $1 has field $2.])
19 undefine([foo])
20 fi
21 undefine([cache_val])
22 ])