SHARE
TWEET

Untitled

a guest Jun 18th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (sb-alien:load-shared-object "unwind.dll")
  2.  
  3. (sb-alien:define-alien-routine
  4.   ("catches_fn" catches-fn)
  5.   sb-alien:void
  6.   (fn (* T)))
  7.  
  8. (defun sap-to-callable (ptr)
  9.   (sb-alien:sap-alien
  10.     (sb-alien:alien-sap ptr)
  11.     (function sb-alien:void)))
  12.  
  13. (sb-ext:defglobal
  14.   alien-callback
  15.   (sb-alien:alien-sap
  16.     (sb-alien::alien-lambda sb-alien:void ((ptr (* t)))
  17.       (format *error-output* "Lisp callback~%")
  18.       (unwind-protect (sb-alien:alien-funcall (sap-to-callable ptr))
  19.         (format *error-output* "Lisp unwind")))))
  20.  
  21. (defun test-seh ()
  22.   (catches-fn alien-callback)
  23.   (values))
  24.  
  25. (test-seh)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top