From e5aab77b7c4ce20fb7c37f9817f7fcec099bf28a Mon Sep 17 00:00:00 2001 From: Sebastien Binet Date: Wed, 23 May 2018 15:54:14 +0200 Subject: [PATCH] hdf5: first stab at hdf5-1.10 support This CL is a first step towards supporting new features and APIs of HDF5 v1.10. Right now, anecdotal evidence shows that HDF5 v1.8 is still massively deployed so support for 1.10 has to be opt-in, by way of an optional build tag aptly named "hdf5-v1.10" Updates gonum/hdf5#16. --- .travis.yml | 7 ++++--- h5f_1.10.go | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 h5f_1.10.go diff --git a/.travis.yml b/.travis.yml index 3ddd06a..094f096 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,7 @@ addons: env: global: - GODEBUG=cgocheck=0 + - TAGS=hdf5-v1.8,hdf5-v1.10 notifications: email: @@ -31,7 +32,7 @@ notifications: on_failure: always script: - - go get -d -t -v ./... - - go install -v ./... - - go test -v ./... + - go get -d -t -v -tags=$TAGS ./... + - go install -v -tags=$TAGS ./... + - go test -v -tags=$TAGS ./... diff --git a/h5f_1.10.go b/h5f_1.10.go new file mode 100644 index 0000000..78aa7db --- /dev/null +++ b/h5f_1.10.go @@ -0,0 +1,16 @@ +// Copyright ©2018 The gonum Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build hdf5-v1.10 + +package hdf5 + +// #include "hdf5.h" +import "C" + +// StartSWMRWrite enables SWMR writing mode for this file. +func (f *File) StartSWMRWrite() error { + err := C.H5Fstart_swmr_write(f.id) + return h5err(err) +}