Issue #69 new

Support for using typedef with primitive types

Anonymous created an issue

I'm trying to bind to a library which has a typedef for some sort of integer type, it'd be nice if I could use the typedef ... Tcl_ThreadId syntax with it.

Comments (3)

  1. Jean-Paul Calderone

    I've also encountered this twice so far in working on OpenSSL bindings. Some OpenSSL APIs accept a time_t argument. It seems perhaps I can work around this by writing typedef int time_t; but it seems like typedef ... time_t; (or some other spelling to tell cffi to ask the compiler for the size) would be better.

    Another example that arose that is actually OpenSSL specific is the BN_ULONG type. I worked around this in the same way but I'm more afraid to do this because I don't know what future versions of OpenSSL will do to BN_ULONG (I also don't know if typedef int BN_ULONG; is actually correct or not given the actual type definition is unsigned and can possibly be any of int, long, or even long long depending on platform).

  2. Log in to comment