diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 17:20:00 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 17:20:00 +0000 |
commit | 8daa83a594a2e98f39d764422bfbdbc62c9efd44 (patch) | |
tree | 4099e8021376c7d8c05bdf8503093d80e9c7bad0 /third_party/heimdal/cf/have-struct-field.m4 | |
parent | Initial commit. (diff) | |
download | samba-8daa83a594a2e98f39d764422bfbdbc62c9efd44.tar.xz samba-8daa83a594a2e98f39d764422bfbdbc62c9efd44.zip |
Adding upstream version 2:4.20.0+dfsg.upstream/2%4.20.0+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/heimdal/cf/have-struct-field.m4')
-rw-r--r-- | third_party/heimdal/cf/have-struct-field.m4 | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/third_party/heimdal/cf/have-struct-field.m4 b/third_party/heimdal/cf/have-struct-field.m4 new file mode 100644 index 0000000..bb7bcef --- /dev/null +++ b/third_party/heimdal/cf/have-struct-field.m4 @@ -0,0 +1,21 @@ +dnl $Id$ +dnl +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_COMPILE_IFELSE([AC_LANG_PROGRAM([[$3]], + [[$1 x; memset(&x, 0, sizeof(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]) +]) |