From 461343ff5dba99f635253e50042a049a38d47a1c Mon Sep 17 00:00:00 2001 From: battlmonstr Date: Tue, 9 Jan 2024 09:43:28 +0100 Subject: [PATCH] mdbx_version description string (#131) --- mdbx/mdbx.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mdbx/mdbx.go b/mdbx/mdbx.go index c312955..83cd918 100644 --- a/mdbx/mdbx.go +++ b/mdbx/mdbx.go @@ -132,6 +132,8 @@ package mdbx #cgo windows LDFLAGS: -lntdll #cgo !android,linux LDFLAGS: -lrt + +#include "mdbxgo.h" */ import "C" @@ -162,3 +164,10 @@ CGO_CFLAGS="${CGO_CFLAGS} -DMDBX_DEBUG=1 -DMDBX_FORCE_ASSERTIONS=1 -v" go run ./ // verstr := C.mdbx_version(&maj, &min, &pat) // return C.GoString(verstr) //} + +// Version returns the C library version string in git describe format. +// +// See mdbx_version. +func Version() string { + return C.GoString(C.mdbx_version.git.describe) +}