1818
1919#include <netcdf.h>
2020#include <netcdf_meta.h>
21-
21+ #ifdef PIO_ENABLE_GDAL
2222#include <gdal.h>
23-
23+ #endif
2424#define NETCDF_VERSION_LE (Maj , Min , Pat ) \
2525 (((NC_VERSION_MAJOR == Maj) && (NC_VERSION_MINOR == Min) && (NC_VERSION_PATCH <= Pat)) || \
2626 ((NC_VERSION_MAJOR == Maj) && (NC_VERSION_MINOR < Min)) || (NC_VERSION_MAJOR < Maj))
@@ -611,12 +611,13 @@ typedef struct file_desc_t
611611 * feature. One consequence is that PIO_IOTYPE_NETCDF4C files will
612612 * not have deflate automatically turned on for each var. */
613613 int ncint_file ;
614-
614+ #ifdef PIO_ENABLE_GDAL
615615 /** GDAL specific vars - M.Long */
616616 GDALDatasetH * hDS ;
617617 int dateVarID ; // Index of field with type OFTDate
618618 int timeVarID ; // Index of field with type OFTTime
619619 int datetimeVarID ; // Index of field with type OFTDatetime
620+ #endif
620621
621622} file_desc_t ;
622623
@@ -640,6 +641,7 @@ enum PIO_IOTYPE
640641
641642 /** GDAL (serial only) */
642643 PIO_IOTYPE_GDAL = 5
644+
643645};
644646
645647/**
@@ -1371,7 +1373,7 @@ extern "C" {
13711373 const long long * op );
13721374 int nc_put_vard_ulonglong (int ncid , int varid , int decompid , const size_t recnum ,
13731375 const unsigned long long * op );
1374-
1376+ #ifdef PIO_ENABLE_GDAL
13751377 /* These functions are for the GDAL integration layer. MSL - 9/7/2023 */
13761378 int GDALc_inq_fieldid (int fileid , const char * name , int * varidp );
13771379 int GDALc_inq_timeid (int fileid , int * timeid ); // Is there a field of type OFTDate, OFTTime, or OFTDateTime?
@@ -1385,7 +1387,7 @@ extern "C" {
13851387 int pio_read_darray_shp (file_desc_t * file , io_desc_t * iodesc , int vid , void * iobuf );
13861388 int pio_gdal_read_features_par (int fileid , int varid , io_desc_t * ddesc , float * ip );
13871389 int pio_read_darray_shp_par (file_desc_t * file , io_desc_t * iodesc , int vid , void * iobuf );
1388-
1390+ #endif
13891391#if defined(__cplusplus )
13901392 }
13911393#endif
0 commit comments