--- boost/config/compiler/clang_version.hpp
+++ boost/config/compiler/clang_version.hpp
@@ -1,9 +1,9 @@
 // Copyright 2021 Peter Dimov
 // Distributed under the Boost Software License, Version 1.0.
 // https://www.boost.org/LICENSE_1_0.txt)
 
-#if !defined(__APPLE__)
+#if !defined(__apple_build_version__)
 
 # define BOOST_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__ % 100)
 
 #else
