[Vala] VAPI-Bindings to obscure c-types.



Hi there.

First of all, sorry for the bad subject-line, but I'm really missing the
words to describe this in a concise manner.

As some of you know, I am playing with writing a GLib wrapper for
libode6. I've come across another problem that I don't think has been
documented on this mailinglist or elsewhere yet:

In libode's code, there is a type called dReal. Depending on some
compiler flags, dReal might be a double or a float:

#if defined(dSINGLE)
typedef float dReal;
#ifdef dDOUBLE
#error You can only #define dSINGLE or dDOUBLE, not both.
#endif /* dDOUBLE */
#elif defined(dDOUBLE)
typedef double dReal;
#else
#error You must #define dSINGLE or dDOUBLE
#endif

The library then uses dReal in various method signatures that I have to
bind against. Is there any possibility to cover this in vala? I can
never know which distribution sets libode's compiler flags in which way,
so I fear my VAPI would break on some systems.

Help's very appreciated.

Yours, Grindhold




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]