Skip to content

Commit

Permalink
Future-proof APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
lnicola committed May 31, 2023
1 parent b486cf6 commit 1eb77c8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/dataset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,14 +408,14 @@ impl Dataset {
///
/// Note: on GDAL versions older than 3.7, this function always succeeds.
pub fn flush_cache(&mut self) -> Result<()> {
#[cfg(any(all(major_ge_3, minor_ge_7)))]
#[cfg(any(all(major_ge_3, minor_ge_7), major_ge_4))]
{
let rv = unsafe { gdal_sys::GDALFlushCache(self.c_dataset) };
if rv != CPLErr::CE_None {
return Err(_last_cpl_err(rv));
}
}
#[cfg(not(any(all(major_ge_3, minor_ge_7))))]
#[cfg(not(any(all(major_is_3, minor_ge_7), major_ge_4)))]
{
unsafe {
gdal_sys::GDALFlushCache(self.c_dataset);
Expand All @@ -430,14 +430,14 @@ impl Dataset {
///
/// Note: on GDAL versions older than 3.7, this function always succeeds.
pub fn close(&mut self) -> Result<()> {
#[cfg(any(all(major_ge_3, minor_ge_7)))]
#[cfg(any(all(major_ge_3, minor_ge_7), major_ge_4))]
{
let rv = unsafe { gdal_sys::GDALClose(self.c_dataset) };
if rv != CPLErr::CE_None {
return Err(_last_cpl_err(rv));
}
}
#[cfg(not(any(all(major_ge_3, minor_ge_7))))]
#[cfg(not(any(all(major_is_3, minor_ge_7), major_ge_4)))]
{
unsafe {
gdal_sys::GDALClose(self.c_dataset);
Expand Down

0 comments on commit 1eb77c8

Please sign in to comment.