C bindings: typedef struct conflicts with method

Mike Parker via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jul 23 00:53:09 PDT 2015


On Thursday, 23 July 2015 at 06:26:28 UTC, Jacob Carlborg wrote:
> On 2015-07-23 03:57, Mike Parker wrote:
>
>> In your case, rd_kafka_metadata is the name of the struct, but 
>> in C
>> instances would need to be declared like so:
>>
>> struct rd_kafka_metadata instance;
>
> Since the struct is declared directly in the typedef, is the 
> struct name actually available?

Yes. It's just short hand for this:

typedef struct foo foo_t;
struct foo {}


More information about the Digitalmars-d-learn mailing list