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 name='id' value='59134f1e02dbde6d82e6204b51ca49347b8037d9'/>
AgeCommit message (Expand)Author
2021-03-17gnu: Use PACKAGE/INHERIT in more places....* gnu/packages/algebra.scm (fftwf, fftw-openmpi), gnu/packages/audio.scm (ztoolkit-rsvg), gnu/packages/bioinformatics.scm (python2-dendropy), gnu/packages/boost.scm (boost-with-python2), gnu/packages/check.scm (python2-mock, python2-pytest-mock), gnu/packages/cups.scm (hplip-minimal), gnu/packages/freedesktop.scm (libinput-minimal), gnu/packages/gettext.scm (gnu-gettext), gnu/packages/glib.scm (python2-pygobject), gnu/packages/gnome.scm (gdl-minimal, libsoup-minimal, python2-pyatspi), gnu/packages/groff.scm (groff-minimal), gnu/packages/jami.scm (ffmpeg-jami), gnu/packages/libcanberra.scm (libcanberra/gtk+-2), gnu/packages/lirc.scm (python2-lirc), gnu/packages/llvm.scm (clang-runtime-3.5), gnu/packages/mpi.scm (java-openmpi, openmpi-thread-multiple), gnu/packages/node.scm (libnode), gnu/packages/onc-rpc.scm (libtirpc/hurd), gnu/packages/python-compression.scm (bitshuffle-for-snappy), gnu/packages/python-crypto.scm (python2-pycrypto, python2-cryptography) (python2-cryptography, python2-m2crypto), gnu/packages/python-web.scm (python2-html2text, python2-tornado) (python2-terminado, python2-ndg-httpsclient, python2-websocket-client) (python2-rauth, python2-url, python2-s3transfer), gnu/packages/python-xyz.scm (python2-psutil, python2-serpent) (python2-humanfriendly, python2-empy, python2-parse-type, python2-polib) (python2-jsonschema, python2-pystache, python2-cython, python2-numpydoc) (python2-ipyparallel, python2-traitlets, python2-dbus) (python2-beautifulsoup4, python2-pep517, python2-flake8, python2-llfuse) (python2-tlsh, python-file, python2-notebook, python-jupyter-console-minimal) (python2-contextlib2, python2-promise, python2-anyjson, python2-amqp) (python2-kombu, python2-billiard, python2-celery, python2-whoosh) (python2-jellyfish, python-rope, ptpython-2, python2-binaryornot) (python2-setproctitle, python2-argcomplete, python2-xopen, python2-isort) (python2-radon, python2-rfc6555, python2-activepapers, python2-send2trash) (python2-cloudpickle, python2-reparser), gnu/packages/python.scm (python2-called-python), gnu/packages/qt.scm (python2-sip, python-pyqt-without-qtwebkit, python2-pyqt) (python-qscintilla, python-pyqt+qscintilla), gnu/packages/scanner.scm (sane-backends), gnu/packages/sdl.scm (guile3.0-sdl2), gnu/packages/selinux.scm (checkpolicy, libselinux, libsemanage, secilc) (python-sepolgen, policycoreutils), gnu/packages/serialization.scm (lua5.1-libmpack, lua5.2-libmpack), gnu/packages/simulation.scm (fenics), gnu/packages/statistics.scm (python2-statsmodels), gnu/packages/texinfo.scm (info-reader), gnu/packages/wxwidgets.scm (wxwidgets-gtk2, wxwidgets-gtk2-3.1), gnu/packages/xml.scm (xmlsec-nss), gnu/packages/xorg.scm (uim-gtk, uim-qt), guix/build-system/python.scm (package-with-explicit-python) (strip-python2-variant): Use PACKAGE/INHERIT. Mark H Weaver