@@ -36,11 +36,20 @@ class OGRGRASSLayer final : public OGRLayer
3636 virtual ~OGRGRASSLayer ();
3737
3838 // Layer info
39+ #if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(3,12,0)
40+ auto GetName () const -> const char * override
41+ #else
3942 auto GetName () -> const char * override
43+ #endif
4044 {
4145 return osName.c_str ();
4246 }
47+
48+ #if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(3,12,0)
49+ auto GetLayerDefn () const -> const OGRFeatureDefn * override
50+ #else
4351 auto GetLayerDefn () -> OGRFeatureDefn * override
52+ #endif
4453 {
4554 return poFeatureDefn;
4655 }
@@ -58,8 +67,13 @@ class OGRGRASSLayer final : public OGRLayer
5867 }
5968#endif
6069
61- virtual auto GetSpatialRef () -> OGRSpatialReference * override ;
70+ #if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(3,12,0)
71+ auto GetSpatialRef () const -> const OGRSpatialReference * override ;
72+ auto TestCapability (const char *) const -> int override ;
73+ #else
74+ auto GetSpatialRef () -> OGRSpatialReference * override ;
6275 auto TestCapability (const char *) -> int override ;
76+ #endif
6377
6478 // Reading
6579 void ResetReading () override ;
@@ -145,13 +159,23 @@ class OGRGRASSDataSource final : public OGRDataSource
145159 {
146160 return osName.c_str ();
147161 }
162+
163+ #if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(3,12,0)
164+ auto GetLayerCount () const -> int override
165+ #else
148166 auto GetLayerCount () -> int override
167+ #endif
149168 {
150169 return nLayers;
151170 }
152- auto GetLayer (int ) -> OGRLayer * override ;
153171
172+ #if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(3,12,0)
173+ auto GetLayer (int ) const -> const OGRLayer * override ;
174+ auto TestCapability (const char *) const -> int override ;
175+ #else
176+ auto GetLayer (int ) -> OGRLayer * override ;
154177 auto TestCapability (const char *) -> int override ;
178+ #endif
155179
156180 private:
157181 OGRGRASSLayer **papoLayers{nullptr };
0 commit comments