mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-22 04:01:17 +00:00
Added acinclude.m4 with AC_HAVE_STRUCT_FIELD() macro.
This commit is contained in:
parent
3e560f5cfd
commit
5410b16ec8
1 changed files with 17 additions and 0 deletions
17
acinclude.m4
Normal file
17
acinclude.m4
Normal file
|
@ -0,0 +1,17 @@
|
|||
dnl check for fields in a structure
|
||||
dnl
|
||||
dnl AC_HAVE_STRUCT_FIELD(struct, field, headers)
|
||||
|
||||
AC_DEFUN(AC_HAVE_STRUCT_FIELD, [
|
||||
define(cache_val, translit(ac_cv_type_$1_$2, [A-Z ], [a-z_]))
|
||||
AC_CACHE_CHECK([for $2 in $1], cache_val,[
|
||||
AC_TRY_COMPILE([$3],[$1 x; x.$2;],
|
||||
cache_val=yes,
|
||||
cache_val=no)])
|
||||
if test "$cache_val" = yes; then
|
||||
define(foo, translit(HAVE_$1_$2, [a-z ], [A-Z_]))
|
||||
AC_DEFINE(foo, 1, [Define if $1 has field $2.])
|
||||
undefine(foo)
|
||||
fi
|
||||
undefine(cache_val)
|
||||
])
|
Loading…
Reference in a new issue