From 5b94c0a0b65d04f55a0a37d721778fb6e364d444 Mon Sep 17 00:00:00 2001 From: david-macmahon Date: Tue, 26 Mar 2024 22:49:19 +0200 Subject: [PATCH] Update helpers.jl with initial value for Ref{Cuint} (#1138) * Update helpers.jl with initial value for Ref{Cuint} Fixes #1137 * Switch to using Cuchar --------- Co-authored-by: Mark Kittisopikul Co-authored-by: Mark Kittisopikul --- gen/api_defs.jl | 2 +- src/api/functions.jl | 4 ++-- src/api/helpers.jl | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gen/api_defs.jl b/gen/api_defs.jl index c0c3f93f9..0aaeaf65f 100644 --- a/gen/api_defs.jl +++ b/gen/api_defs.jl @@ -27,7 +27,7 @@ @bind h5_free_memory(buf::Ptr{Cvoid})::herr_t "Error freeing memory" @bind h5_garbage_collect()::herr_t "Error on garbage collect" @bind h5_get_libversion(majnum::Ref{Cuint}, minnum::Ref{Cuint}, relnum::Ref{Cuint})::herr_t "Error getting HDF5 library version" -@bind h5_is_library_threadsafe(is_ts::Ref{Cuint})::herr_t "Error determining thread safety" +@bind h5_is_library_threadsafe(is_ts::Ref{Cuchar})::herr_t "Error determining thread safety" @bind h5_open()::herr_t "Error initializing the HDF5 library" @bind h5_set_free_list_limits(reg_global_lim::Cint, reg_list_lim::Cint, arr_global_lim::Cint, arr_list_lim::Cint, blk_global_lim::Cint, blk_list_lim::Cint)::herr_t "Error setting limits on free lists" diff --git a/src/api/functions.jl b/src/api/functions.jl index 311b4651c..46f5adee0 100644 --- a/src/api/functions.jl +++ b/src/api/functions.jl @@ -92,14 +92,14 @@ function h5_get_libversion(majnum, minnum, relnum) end """ - h5_is_library_threadsafe(is_ts::Ref{Cuint}) + h5_is_library_threadsafe(is_ts::Ref{Cuchar}) See `libhdf5` documentation for [`H5is_library_threadsafe`](https://docs.hdfgroup.org/hdf5/v1_14/group___h5.html#ga70bfde4acd009cdd7bcd2f54c594e28a). """ function h5_is_library_threadsafe(is_ts) lock(liblock) var"#status#" = try - ccall((:H5is_library_threadsafe, libhdf5), herr_t, (Ref{Cuint},), is_ts) + ccall((:H5is_library_threadsafe, libhdf5), herr_t, (Ref{Cuchar},), is_ts) finally unlock(liblock) end diff --git a/src/api/helpers.jl b/src/api/helpers.jl index f77cb26da..1b0fdb117 100644 --- a/src/api/helpers.jl +++ b/src/api/helpers.jl @@ -26,7 +26,7 @@ function h5_get_libversion() end function h5_is_library_threadsafe() - is_ts = Ref{Cuint}() + is_ts = Ref{Cuchar}(0) h5_is_library_threadsafe(is_ts) return is_ts[] > 0 end