Commit 5edadf95 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Do not compile delegate wrapper function if wrapped library is unavailable.

parent 76ff464a
......@@ -307,21 +307,20 @@ void grbReadRecord(stream_t * streamptr, double *data, int *nmiss)
static
int grbScanTimestep1(stream_t * streamptr)
{
int status;
int filetype;
filetype = streamptr->filetype;
int status = CDI_EUFTYPE;
#if defined (HAVE_LIBCGRIBEX)
int filetype = streamptr->filetype;
if ( filetype == FILETYPE_GRB )
{
status = cgribexScanTimestep1(streamptr);
}
status = cgribexScanTimestep1(streamptr);
#endif
#if defined(HAVE_LIBCGRIBEX) && defined (HAVE_LIBGRIB_API)
else
#endif
{
status = gribapiScanTimestep1(streamptr);
}
#ifdef HAVE_LIBGRIB_API
status = gribapiScanTimestep1(streamptr);
#endif
return (status);
}
......@@ -329,12 +328,11 @@ int grbScanTimestep1(stream_t * streamptr)
static
int grbScanTimestep2(stream_t * streamptr)
{
int status = 0;
int filetype;
filetype = streamptr->filetype;
int status = CDI_EUFTYPE;
#if defined (HAVE_LIBCGRIBEX)
int filetype = streamptr->filetype;
if ( filetype == FILETYPE_GRB )
{
status = cgribexScanTimestep2(streamptr);
......@@ -375,6 +373,7 @@ int grbScanTimestep(stream_t * streamptr)
}
#if defined (HAVE_LIBGRIB)
int grbInqContents(stream_t * streamptr)
{
int fileID;
......@@ -392,7 +391,7 @@ int grbInqContents(stream_t * streamptr)
return (status);
}
#endif
int grbInqTimestep(stream_t * streamptr, int tsID)
{
......
......@@ -804,9 +804,9 @@ static checkTimeResult checkTime(stream_t* streamptr, compvar2_t compVar, const
} \
while(0)
#if defined (HAVE_LIBGRIB_API)
int gribapiScanTimestep1(stream_t * streamptr)
{
#if defined (HAVE_LIBGRIB_API)
off_t recpos = 0;
unsigned char *gribbuffer = NULL;
size_t buffersize = 0;
......@@ -998,13 +998,10 @@ int gribapiScanTimestep1(stream_t * streamptr)
}
}
}
#else
(void)streamptr;
Error("GRIB_API support not compiled in!");
#endif
return (0);
}
#endif
#ifdef HAVE_LIBGRIB_API
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment