Use #if guards to handle different dune versions.