Commit fddea468 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Conditionalize cdfInqHistorySize and related.

parent 1a130ddd
......@@ -8280,19 +8280,17 @@ void cdfDefHistory(stream_t *streamptr, int size, const char *history)
#endif
#if defined (HAVE_LIBNETCDF)
int cdfInqHistorySize(stream_t *streamptr)
{
size_t size = 0;
#if defined (HAVE_LIBNETCDF)
int ncid;
ncid = streamptr->fileID;
int ncid = streamptr->fileID;
if ( streamptr->historyID != UNDEFID )
cdf_inq_attlen(ncid, NC_GLOBAL, "history", &size);
#endif
return ((int) size);
}
#endif
void cdfInqHistoryString(stream_t *streamptr, char *history)
......
......@@ -42,9 +42,8 @@ void streamDefHistory(int streamID, int length, const char *history)
int streamInqHistorySize(int streamID)
{
int size = 0;
stream_t *streamptr;
streamptr = stream_to_pointer(streamID);
#ifdef HAVE_LIBNETCDF
stream_t *streamptr = stream_to_pointer(streamID);
if ( streamptr->filetype == FILETYPE_NC ||
streamptr->filetype == FILETYPE_NC2 ||
......@@ -53,7 +52,9 @@ int streamInqHistorySize(int streamID)
{
size = cdfInqHistorySize(streamptr);
}
#else
(void)streamID;
#endif
return (size);
}
......
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