Skip to content

Commit

Permalink
adjust BufferWrapper destructor for old Nim
Browse files Browse the repository at this point in the history
  • Loading branch information
Vindaar committed Mar 11, 2024
1 parent ab5fa01 commit 2e74c73
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/nimhdf5/hdf5_json.nim
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@ type

MemberSizeTable = OrderedTable[string, (int, int, DtypeKind)]

proc `=destroy`(buf: BufferWrapperObj) =
buf.cleanup(buf.buf, buf.dtypeID, buf.dspaceID)
`=destroy`(buf.buf)
when (NimMajor, NimMinor, NimPatch) >= (2, 0, 0):
proc `=destroy`(buf: BufferWrapperObj) =
buf.cleanup(buf.buf, buf.dtypeID, buf.dspaceID)
`=destroy`(buf.buf)
else:
proc `=destroy`(buf: var BufferWrapperObj) =
buf.cleanup(buf.buf, buf.dtypeID, buf.dspaceID)

Check warning on line 23 in src/nimhdf5/hdf5_json.nim

View workflow job for this annotation

GitHub Actions / linux (version-1-6)

Exception can raise an unlisted exception: Exception [Effect]

Check warning on line 23 in src/nimhdf5/hdf5_json.nim

View workflow job for this annotation

GitHub Actions / linux (version-1-6)

Exception can raise an unlisted exception: Exception [Effect]
`=destroy`(buf.buf)

## Code to read also datasets and groups as JSON:

Expand Down

0 comments on commit 2e74c73

Please sign in to comment.