Commit cc503c04c for imagemagick.org

commit cc503c04ce948f2336524747e38d53e1022494ec
Author: Dirk Lemstra <dirk@lemstra.org>
Date:   Sun Apr 12 12:00:19 2026 +0200

    Avoid conflicts with -std options when trying to check if the -x c++ option is supported.

diff --git a/configure.ac b/configure.ac
index d3768cb30..548268ea0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3598,7 +3598,19 @@ magick_channel_mask_depth='32';
 if test "$enable_64bit_channel_masks" = 'yes'; then
     if test "$enable_force_cpp" = 'yes'; then
         AC_MSG_CHECKING([whether the compiler supports -x c++ option])
+        old_CC="$CC"
         old_CFLAGS="$CFLAGS"
+        cpp_CC=''
+        for option in $CC; do
+          case "$option" in
+            -std=c*|-std=gnu*)
+              ;;
+            *)
+              cpp_CC="$cpp_CC $option"
+              ;;
+          esac
+        done
+        CC="$cpp_CC"
         CFLAGS="$CFLAGS -x c++"
         AC_COMPILE_IFELSE([
           AC_LANG_PROGRAM([
@@ -3613,6 +3625,7 @@ if test "$enable_64bit_channel_masks" = 'yes'; then
           AC_MSG_RESULT([no])
         ])
         if test "$magick_channel_mask_depth" != '64'; then
+          CC="$old_CC"
           CFLAGS="$old_CFLAGS"
         fi
     else