Skip to content

Commit

Permalink
now it re-compile also with 1.14
Browse files Browse the repository at this point in the history
  • Loading branch information
picca committed Jan 7, 2025
1 parent 4a181ea commit d141140
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 42 deletions.
14 changes: 7 additions & 7 deletions src/Bindings/HDF5/Link.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,13 @@ data LinkInfo = LinkInfo

#if H5_VERSION_GE(1,12,0)

readLinkInfo :: H5L_info1_t -> LinkInfo
readLinkInfo :: H5L_info_t -> LinkInfo
readLinkInfo i = LinkInfo
{ linkType = linkTypeFromCode (h5l_info1_t'type i)
, linkCOrderValid = hboolToBool (h5l_info1_t'corder_valid i)
, linkCOrder = h5l_info1_t'corder i
, linkCSet = cSetFromCode (h5l_info1_t'cset i)
, linkValSize = h5l_info1_t'u'val_size i
{ linkType = linkTypeFromCode (h5l_info_t'type i)
, linkCOrderValid = hboolToBool (h5l_info_t'corder_valid i)
, linkCOrder = h5l_info_t'corder i
, linkCSet = cSetFromCode (h5l_info_t'cset i)
, linkValSize = h5l_info_t'u'val_size i
}

getLinkInfo :: Location loc => loc -> BS.ByteString -> Maybe LAPL -> IO LinkInfo
Expand All @@ -191,7 +191,7 @@ getSymLinkVal loc name mb_lapl =
info <- withOut_ $ \info ->
withErrorCheck_ $
h5l_get_info1 (hid loc) cname info lapl
let n = h5l_info1_t'u'val_size info
let n = h5l_info_t'u'val_size info

buf <- mallocBytes (fromIntegral n)

Expand Down
27 changes: 11 additions & 16 deletions src/Bindings/HDF5/Raw/H5L.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -89,24 +89,19 @@ type H5L_iterate_t a = FunPtr (HId_t -> CString -> In H5L_info_t -> InOut a -> I

#if H5_VERSION_GE(1,12,0)

#starttype H5L_info1_t
#field type, <H5L_type_t>
#field corder_valid, <hbool_t>
#field corder, Int64
#field cset, <H5T_cset_t>
#union_field u.address, <haddr_t>
#union_field u.val_size, <size_t>
#stoptype

#ccall H5Lget_info1, <hid_t> -> CString -> Out <H5L_info1_t> -> <hid_t> -> IO <herr_t>
#ccall H5Lget_info_by_idx1, <hid_t> -> CString -> <H5_index_t> -> <H5_iter_order_t> -> <hsize_t> -> Out <H5L_info1_t> -> <hid_t> -> IO <herr_t>

type H5L_info1_t = H5L_info_t
type H5L_iterate1_t a = FunPtr (HId_t -> CString -> In H5L_info1_t -> InOut a -> IO HErr_t)

#ccall H5Literate1, <hid_t> -> <H5_index_t> -> <H5_iter_order_t> -> InOut <hsize_t> -> H5L_iterate1_t a -> InOut a -> IO <herr_t>
#ccall H5Literate_by_name1, <hid_t> -> CString -> <H5_index_t> -> <H5_iter_order_t> -> InOut <hsize_t> -> H5L_iterate1_t a -> InOut a -> <hid_t> -> IO <herr_t>
#ccall H5Lvisit1, <hid_t> -> <H5_index_t> -> <H5_iter_order_t> -> H5L_iterate1_t a -> InOut a -> IO <herr_t>
#ccall H5Lvisit_by_name1, <hid_t> -> CString -> <H5_index_t> -> <H5_iter_order_t> -> H5L_iterate1_t a -> InOut a -> <hid_t> -> IO <herr_t>
h5l_get_info :: HId_t -> CString -> Out H5L_info1_t -> HId_t -> IO HErr_t
h5l_get_info = h5l_get_info1
h5l_iterate :: HId_t -> H5_index_t -> H5_iter_order_t -> InOut HSize_t -> H5L_iterate1_t a -> InOut a -> IO HErr_t
h5l_iterate = h5l_iterate1
h5l_iterate_by_name :: HId_t -> CString -> H5_index_t -> H5_iter_order_t -> InOut HSize_t -> H5L_iterate1_t a -> InOut a -> HId_t -> IO HErr_t
h5l_iterate_by_name = h5l_iterate_by_name1
h5l_visit :: HId_t -> H5_index_t -> H5_iter_order_t -> H5L_iterate1_t a -> InOut a -> IO HErr_t
h5l_visit = h5l_visit1
h5l_visit_by_name :: HId_t -> CString -> H5_index_t -> H5_iter_order_t -> H5L_iterate1_t a -> InOut a -> HId_t -> IO HErr_t
h5l_visit_by_name = h5l_visit_by_name1

#starttype H5L_info2_t
#field type, <H5L_type_t>
Expand Down
20 changes: 1 addition & 19 deletions src/Bindings/HDF5/Raw/H5O.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -421,11 +421,7 @@ type H5O_mcdt_search_cb_t a = FunPtr (InOut a -> IO H5O_mcdt_search_ret_t)
--
-- > herr_t H5Ovisit(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order,
-- > H5O_iterate_t op, void *op_data);
#if (H5Fget_info_vers == 1)
#ccall H5Ovisit, <hid_t> -> <H5_index_t> -> <H5_iter_order_t> -> H5O_iterate_t a -> InOut a -> IO <herr_t>
#else
#ccall H5Ovisit, <hid_t> -> <H5_index_t> -> <H5_iter_order_t> -> H5O_iterate2_t a -> InOut a -> IO <herr_t>
#endif

-- |Recursively visit an object and all the objects reachable
-- from it. If the starting object is a group, all the objects
Expand Down Expand Up @@ -511,21 +507,7 @@ type H5O_iterate_t a = FunPtr (HId_t -> CString -> In H5O_info_t -> InOut a -> I

#if H5_VERSION_GE(1,12,0)

#starttype H5O_info1_t
#field fileno, CULong
#field addr, <haddr_t>
#field type, <H5O_type_t>
#field rc, CUInt
#field atime, <time_t>
#field mtime, <time_t>
#field ctime, <time_t>
#field btime, <time_t>
#field num_attrs, <hsize_t>
#field hdr, <H5O_hdr_info_t>
#field meta_size.obj, <H5_ih_info_t>
#field meta_size.attr, <H5_ih_info_t>
#stoptype

type H5O_info1_t = H5O_info_t
type H5O_iterate1_t a = FunPtr (HId_t -> CString -> In H5O_info1_t -> InOut a -> IO HErr_t)

#starttype H5O_token_t
Expand Down

0 comments on commit d141140

Please sign in to comment.