using C with D

Gregor Richards Richards at codu.org
Mon Jul 23 09:16:42 PDT 2007


Micah Heyer wrote:
> Gregor Richards wrote:
>>
>> Not only is it feasible, I did it months ago.
>>
>> http://www.dsource.org/projects/bcd/
>>
>>  - Gregor Richards
> Ah, thats a nifty little program,I think info about it should be placed 
> in the faq.One question though: What's all the aliased function pointers 
> I keep getting in the output?
> alias int function(void *, void *) _BCD_func__788;
> alias int function(void *) _BCD_func__409;
> alias int function(void *, long *, int) _BCD_func__411;
> alias int function(void *, char *, uint) _BCD_func__413;
> alias int function(void *, char *, uint) _BCD_func__415;
> alias void function(void *) _BCD_func__895;
> alias int function(void * *, char *) _BCD_func__896;
> alias int function(char *, char * * *, uint *) _BCD_func__897;
> alias int function(void *, char *, char *, char *, char *) _BCD_func__898;
> alias int function(__gconv_step *, __gconv_step_data *, void *, char *, 
> char * *, char *, char * *, uint *) _BCD_func__899;
> alias void function(__gconv_step *) _BCD_func__900;
> alias int function(__gconv_step *) _BCD_func__901;
> alias uint function(__gconv_step *, char) _BCD_func__902;
> alias int function(__gconv_step *, __gconv_step_data *, char * *, char 
> *, char * *, uint *, int, int) _BCD_func__903;
> 
> I was converting sdl headers btw.
> 
> -micah

Because of how GCCXML works internally, it's easier to alias the 
functions to alternative names in one step, and then use those 
alternative names in another step. It's a bit weird, but it doesn't make 
life any more difficult so long as you stick to this one rule: Don't use 
the generated .d files as documentation, use the .h files :)

  - Gregor Richards

PS: The lines with gconv_step is a bug I haven't tracked down. It's easy 
to fix the generated headers by just removing those lines.



More information about the Digitalmars-d mailing list