I use ffib and lcpp (with my searcher). After loading the headers from <sys/types.h> , instead of char , int arrays and variables are created.

It looks like this:

 th> ffi.new('char[10]') cdata<char[10]>: 0x2366d98 [0.0002s] th> ffi.cdef[[#include <sys/types.h>]] [0.7561s] th> ffi.new('char[10]') cdata<int[10]>: 0x25bf3a8 

What's the matter with this library?

    1 answer 1

    If you don’t introduce yourself as a compiler, the library gets too smart, and overrides char as an int . This is simply solved by three define -ami:

     ffi.cdef [[#define __GNUC__ 5 #define __GNUC_MINOR__ 1 #define __STDC__ 1]]