From 1da99396dc65993ba34ac0370ca5d6acda6a3322 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Sun, 18 Mar 2018 07:02:37 -0400 Subject: [PATCH] Add support for gdbm-1.14. As of gdbm-1.14, 'gdbm_errno' no longer exists as a binary interface. It has been replaced by 'gdbm_errno_location', a function that returns int*. We now use this new interface if it's available. --- gdbm.scm | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/gdbm.scm b/gdbm.scm index b92992f..4d38cc3 100644 --- a/gdbm.scm +++ b/gdbm.scm @@ -17,6 +17,9 @@ ;; You should have received a copy of the GNU General Public License ;; along with this program. If not, see . +;; Modified by Mark H Weaver in March 2018 to support +;; gdbm-1.14 with its new 'gdbm_errno_location' interface. + (define-module (gdbm) #:use-module (system foreign) #:use-module (rnrs bytevectors) @@ -151,10 +154,21 @@ ;;; errors -(define %errno (dynamic-pointer "gdbm_errno" libgdbm)) +(define %list-int + (list int)) + +(define (dereference-int ptr) + (apply (lambda (errno) errno) + (parse-c-struct ptr %list-int))) + +(define %errno-location + (or (false-if-exception + (let ((func (dynamic-func "gdbm_errno_location" libgdbm))) + (pointer->procedure '* func '()))) + (const (dynamic-pointer "gdbm_errno" libgdbm)))) (define (gdbm-errno) - (pointer-address (dereference-pointer %errno))) + (dereference-int (%errno-location))) (define (gdbm-error) (error (pointer->string (%gdbm-strerror (gdbm-errno))))) -- 2.16.2 1ad5b5e6'>diff
ariables....
AgeCommit message (Expand)Author
2021-03-10ci: Remove hydra support....Mathieu Othacehe
2018-12-04Remove most references to hydra.gnu.org....Ludovic Courtès
2018-03-25maint: Adjust 'check-final-inputs-self-contained' for glibc:static....Ludovic Courtès
2017-05-08maint: Use 'G_' in build-aux/ scripts....Ludovic Courtès
2016-12-18build: check-final-inputs-self-contained has an exception for 'bash:include'....Ludovic Courtès
Ludovic Courtès
2020-09-14daemon: Move 'Agent' to libutil....Ludovic Courtès
2020-06-27daemon: Recognize SHA3 and BLAKE2s....Ludovic Courtès
2020-06-27daemon: Remove OpenSSL hash compatibility wrappers....Ludovic Courtès
2020-06-27daemon: Map directly to gcrypt hash functions....Ludovic Courtès
2020-06-24nix: Tweak .gitignore files....Christopher Baines
2020-03-26daemon: Avoid kill -1 bug on the Hurd....Manolis Ragkousis
2020-01-12daemon: Account for deleted store files when deduplication is on....Ludovic Courtès
2019-11-29daemon: 'pathExists' uses 'statx' when available....Ludovic Courtès
2019-11-27daemon: 'deletePath' uses 'statx' when available....Ludovic Courtès