<!DOCTYPE html><html><head><title></title><style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div>><br></div><blockquote type="cite" id="qt"><div class="qt-"><br></div><div class="qt-"><div class="qt-">Hello,<br></div><div class="qt-"><br></div><div class="qt-">From the  CFFI manual, Section 4.9,  I understand that <br></div><div class="qt-"><br></div><div class="qt-">>> "Implementor’s note: size_t is almost always an unsigned int.”<br></div><div class="qt-"><br></div><div class="qt-">However, this seems to fail on a 64 bit Linux computers, where the C ints are 32 bit<br></div><div class="qt-"><br></div><div class="qt-">I’ve had better success with <br></div><div class="qt-"><br></div><div class="qt-"><div class="qt-" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:normal;background-color:rgb(255, 255, 255);"><div class="qt-" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:normal;"><span class="font" style="font-family:Menlo;"><span class="qt-" style=""><span class="size" style="font-size:11px;">(cffi:defctype size_t #.(cond ((= 4 (cffi:foreign-type-size :pointer))</span></span></span><br></div><div class="qt-" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:normal;"><span class="font" style="font-family:Menlo;"><span class="qt-" style=""><span class="size" style="font-size:11px;"><span class="qt-Apple-tab-span" style="white-space:pre;"></span>       :uint32)</span></span></span><br></div><div class="qt-" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:normal;"><span class="font" style="font-family:Menlo;"><span class="qt-" style=""><span class="size" style="font-size:11px;"><span class="qt-Apple-tab-span" style="white-space:pre;"></span>      ((= 8 (cffi:foreign-type-size :pointer))</span></span></span><br></div><div class="qt-" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:normal;"><span class="font" style="font-family:Menlo;"><span class="qt-" style=""><span class="size" style="font-size:11px;"><span class="qt-Apple-tab-span" style="white-space:pre;"></span>       :uint64)</span></span></span><br></div><div class="qt-" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:normal;"><span class="font" style="font-family:Menlo;"><span class="qt-" style=""><span class="size" style="font-size:11px;"><span class="qt-Apple-tab-span" style="white-space:pre;"></span>      (t (error "Failed type lisp-pointer-type"))))</span></span></span><br></div><div class="qt-" style="font-family:Menlo;font-size:11px;"><br></div><div class="qt-" style="font-family:Menlo;font-size:11px;"><br></div><div class="qt-">Is this general enough to be trusted everywhere?  If so, should it be part of CFFI, or at least <br></div><div class="qt-">mentioned in the manual?  The current text in the manual doesn’t seem to be working for me, and this<br></div><div class="qt-">is a frequent issue when I port a new foreign library and forget what I did in the past … first thing I do <br></div><div class="qt-">is (apropos “size-t” :cffi) and (apropos “size_t” :cffi) and nothing shows up.<br></div></div></div></div></blockquote><div><br></div><div>That is a mistake, size_t is the same size as the pointer so your manual definition is correct.<br></div><div><br></div><div id="sig4916231"><div>--<br></div><div>Stelian Ionescu<br></div></div><div><br></div></body></html>