diff --git a/dune/vtk/datacollectors/spdatacollector.hh b/dune/vtk/datacollectors/spdatacollector.hh
index 5ec8d538326662f341ec51e891fc95fb7dce54b8..14283856eb337b12e65c6663070d3fd6b8d61b4e 100644
--- a/dune/vtk/datacollectors/spdatacollector.hh
+++ b/dune/vtk/datacollectors/spdatacollector.hh
@@ -1,13 +1,13 @@
 #pragma once
 
-#ifdef HAVE_DUNE_SPGRID
+#if HAVE_DUNE_SPGRID
 #include <dune/grid/spgrid.hh>
 #endif
 #include <dune/vtk/datacollectors/structureddatacollector.hh>
 
 namespace Dune { namespace experimental
 {
-#ifdef HAVE_DUNE_SPGRID
+#if HAVE_DUNE_SPGRID
 
 // Specialization for SPGrid
 template <class GridView>
diff --git a/src/structuredgridwriter.cc b/src/structuredgridwriter.cc
index 5fbcb7d73f503c6ec30dc2319eb1e9e2865b7e61..48afc46ba53b3b23485c8062f2e2e43d6f40904e 100644
--- a/src/structuredgridwriter.cc
+++ b/src/structuredgridwriter.cc
@@ -34,7 +34,7 @@ namespace Impl_
   template <class GridView, class Grid>
   struct StructuredDataCollector;
 
-#ifdef HAVE_DUNE_SPGRID
+#if HAVE_DUNE_SPGRID
   template<class GridView, class ct, int dim, template< int > class Ref, class Comm>
   struct StructuredDataCollector<GridView, SPGrid<ct,dim,Ref,Comm>>
   {
@@ -105,7 +105,7 @@ void write_yaspgrid(std::integral_constant<int,dim>)
 template <int dim>
 void write_spgrid(std::integral_constant<int,dim>)
 {
-#ifdef HAVE_DUNE_SPGRID
+#if HAVE_DUNE_SPGRID
   using GridType = SPGrid<double,dim, SPIsotropicRefinement>;
   FieldVector<double,dim> upperRight; upperRight = 1.0;
   auto numElements = filledArray<dim,int>(8);