[racket] size_t and FFI?

From: Tony Garnock-Jones (tonyg at ccs.neu.edu)
Date: Fri Feb 8 14:40:43 EST 2013

Hi all,

When using Racket's FFI, is there a standard C numeric type
corresponding to size_t? If not, should there be? Many C APIs expose
functions along the lines of

  ... myfunc(..., void *buf, size_t buflen, ...);

and since size_t varies between 32- and 64-bit platforms, I'm unsure
what to supply there.

I note that in collects we have

./db/private/generic/socket.rkt:   (define _size_t _int)
./mred/private/wx/cocoa/image.rkt: (define _size_t _long)
./racket/draw/unsafe/jpeg.rkt:     (define _size_t _intptr)

... of which the last one looks most likely to work properly.


Posted on the users mailing list.