Comment 1 for bug 1924764

Revision history for this message
Jan Igger (le-perv) wrote : Re: conversion from struct

Sorry, here's a cleaned-up version:

(cffi:defctype uint8 :unsigned-char)

(cffi:defcstruct (anon-struct :size 16)
  (data (:array uint8 16) :offset 0))

(cffi:defctype guid (:struct anon-struct))

(cffi:convert-from-foreign
 (foreign-alloc 'guid)
 '(:struct anon-struct))
;; => (DATA #(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0))

(cffi:convert-from-foreign
 (foreign-alloc 'guid)
 'guid)
;; => #.(SB-SYS:INT-SAP #X7FC1E8001950)