From 86f10534dcc24047e503d45e7f51e09b0a89db69 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 22 Feb 2023 11:19:57 +0800 Subject: [PATCH] Add cross-compilation test for cleanup attribute * configure.ac: Per title. --- configure.ac | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index cb2b1370d58..e6a8c760b10 100644 --- a/configure.ac +++ b/configure.ac @@ -4792,7 +4792,20 @@ if test "${with_modules}" != "no"; then ]], [[cleanup_func (); return 1;]])], [emacs_cv_attribute_cleanup=yes], [emacs_cv_attribute_cleanup=no], - [emacs_cv_attribute_cleanup="guessing yes"])]) + [AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ + cleanup_func_1 (k) + int *k; + { + return *k; + }; + cleanup_func () + { + int k __attribute__((cleanup (cleanup_func_1))) = 100; + }]], + [[cleanup_func ()]])], + [emacs_cv_attribute_cleanup="guessing yes"], + [emacs_cv_attribute_cleanup=no])])]) if test "$emacs_cv_attribute_cleanup" = "no"; then if test "${with_modules}" = "ifavailable"; then -- 2.39.5