[racket] FFI and C header defines

From: Bartosz Przygoda (bprzygoda at gmail.com)
Date: Thu Feb 5 16:38:21 EST 2015


I'm implementing FFI for termios functions (I noticed Python has got all
this covered: serial, termios, fnctl and so on, whereas Racket seemed not
(at least serial, which I'm trying to do next)), and I'm wondering how to
tackle the values defined in C headers (especially those that are depending
on other defines), for example:

#ifdef __USE_MISC
# define XTABS 0014000

I'd like to have such values define in my library module, but then what
about differences? Some should be part of POSIX standard, but from what I
see there is lots of ifdefs so some could vary.

I checked Python, and seems such modules are implemented natively, so that
when they get build proper consts are introduced and then such module is
depending on a environment it was build in. Does similar way could be used
for racket? Or what should be generaly favored way of doing such things
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20150205/a8c0f561/attachment.html>

Posted on the users mailing list.