From c6ffeadd2b3a1b6d8101c1eeb25b36b9d4605465 Mon Sep 17 00:00:00 2001 From: Oliver Lantwin Date: Wed, 22 Jul 2026 11:52:46 +0200 Subject: [PATCH] Fix FORM's RNTuple backend build against ROOT 6.40 ROOT 6.40 moved RRawPtrWriteEntry from ROOT::Experimental::Detail to ROOT::Detail. Select the namespace with a ROOT version check so the RNTuple storage backend (FORM_USE_RNTUPLE_STORAGE=ON) compiles against both ROOT 6.38 and 6.40. Fixes #712. --- .../root_rntuple_write_container.hpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/form/root_storage/root_rntuple_write_container.hpp b/form/root_storage/root_rntuple_write_container.hpp index 8a582fb21..e386e120a 100644 --- a/form/root_storage/root_rntuple_write_container.hpp +++ b/form/root_storage/root_rntuple_write_container.hpp @@ -5,6 +5,8 @@ #include "storage/storage_write_association.hpp" +#include "RVersion.h" + #include #include @@ -14,15 +16,28 @@ namespace ROOT { class RNTupleWriter; class RNTupleModel; +#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 40, 0) + namespace Detail { + class RRawPtrWriteEntry; + } +#else namespace Experimental { namespace Detail { class RRawPtrWriteEntry; } } +#endif } namespace form::detail::experimental { + //ROOT 6.40 moved RRawPtrWriteEntry from ROOT::Experimental::Detail to ROOT::Detail. +#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 40, 0) + using RRawPtrWriteEntry = ROOT::Detail::RRawPtrWriteEntry; +#else + using RRawPtrWriteEntry = ROOT::Experimental::Detail::RRawPtrWriteEntry; +#endif + class ROOT_RNTuple_Write_ContainerImp : public Storage_Write_Association { public: ROOT_RNTuple_Write_ContainerImp(std::string const& name); @@ -43,7 +58,7 @@ namespace form::detail::experimental { //State shared by ROOT_RField_ContainerImps std::unique_ptr m_writer; std::unique_ptr m_model; - std::unique_ptr m_entry; + std::unique_ptr m_entry; }; }