d-vulkan, automatically generated D bindings for Vulkan
Alex Parrill via Digitalmars-d-announce
digitalmars-d-announce at puremagic.com
Sat Mar 19 17:52:48 PDT 2016
On Sunday, 20 March 2016 at 00:03:16 UTC, Nicholas Wilson wrote:
> On Saturday, 19 March 2016 at 19:37:38 UTC, Alex Parrill wrote:
>> On Saturday, 19 March 2016 at 12:57:18 UTC, Nicholas Wilson
>> wrote:
>>> On Saturday, 19 March 2016 at 01:12:08 UTC, Alex Parrill
>>> wrote:
>>>
>>> Should be doable using appropriate version blocks.
>>>
>>
>> The problem is that I'd have to define my own structs (Xlib
>> Display, Xlib Window, etc), which will be incompatible with
>> the ones defined in any bindings to those libraries.
>
> You don't. Code in undefined versions need only be
> syntactically valid
> not semantically valid. i.e. the types in versions not compiled
> in need not
> be declared nor defined.
>
> version(none)
> {
> xcb_connection_t* con;
> }
> will compile fine.
Yes, I know. The issue is, when compiling with the version, where
does xcb_connection_t come from? If I declare it myself, as
`struct xcb_connection_t;` in the version block, then that type
will be different than the xcb_connection_t declared in the XCB
bindings that the developer is likely using, and thus they will
be incompatible. If I import a xcb_connection_t from some
bindings, it ties d-vulkan to those bindings, which I'd rather
not do.
More information about the Digitalmars-d-announce
mailing list