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 pe='hidden' name='id' value='d010fc6597731a663473b79736766c85d9f7c381'/>
AgeCommit message (Collapse)Author
2023-02-19etc: Add a news entry snippet.Maxim Cournoyer
* etc/snippets/yas/scheme-mode/guix-news-entry: New file.
2022-11-28snippets: yas: Add snippets for vc.elMorgan Smith
* etc/snippets/yas/log-edit-mode/guix-vc-commit-message-add-package: * etc/snippets/yas/log-edit-mode/guix-vc-commit-message-remove-package: * etc/snippets/yas/log-edit-mode/guix-vc-commit-message-rename-package: * etc/snippets/yas/log-edit-mode/guix-vc-commit-message-update-package: * etc/snippets/yas/log-edit-mode/guix-vc-commit-message-use-https-home-page: New file Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-08-30etc: Update yasnippet build system list.Nicolas Graves
* etc/snippets/yas/scheme-mode/guix-package (build-system): Add chicken-build-system, minetest-build-system, rebar-build-system and renpy-build-system. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
2022-08-30etc: Add tempel snippets.Nicolas Graves
* etc/snippets/tempel/scheme-mode: New file. * etc/snippets/tempel/text-mode: New file. * etc/snippets/scheme-mode: Moved from here... * etc/snippets/yas/scheme-mode: ... to here. * etc/snippets/text-mode: Moved from here... * etc/snippets/yas/text-mode: ... to here. * doc/contributing.texi ("The Perfect Setup"): Adjust yasnippet setup accordingly. Add tempel setup. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>