Can I typedef pointer to extern (C) function?

Rick Mann rmann-d-lang at latencyzero.com
Sat Jan 27 11:08:08 PST 2007


Mike Parker Wrote:

> Oh, and just to be pedantic, typedef and alias are not the same. The 
> subject line says one and the code uses the other.

Yeah; sorry about that. I had trouble posting it the first time (kept getting "Fail to post message"), and when I tried again later I had been experimenting, so I think my example got changed.

> Switch up the 'alias' and extern(C) statements:
> extern(C) alias uint function() EventHandlerProcPtr;

I did eventually discover that, and now I'm just getting Bus errors when my callback happens. My actual code is using Mac OS X's Carbon API, where it calls you back for events. I'm not sure what's causing the problem at this point, but I'll keep poking at it.

Thanks!



More information about the Digitalmars-d mailing list