]> git.eshelyaron.com Git - emacs.git/commitdiff
Add cross-compilation test for cleanup attribute
authorPo Lu <luangruo@yahoo.com>
Wed, 22 Feb 2023 03:19:57 +0000 (11:19 +0800)
committerPo Lu <luangruo@yahoo.com>
Wed, 22 Feb 2023 03:19:57 +0000 (11:19 +0800)
* configure.ac: Per title.

configure.ac

index cb2b1370d5803d0d856330b7fb157e88138b9e95..e6a8c760b105c068a55815b7407e3ce022fbaa35 100644 (file)
@@ -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