www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - extern linkage: function pointer syntax

Now another question:

While translating the Glut.h file (and the other opengl files)
succesfully, I found a new problem:

export extern (Windows) void glut???Proc(void function());

this code doesn't let me change the linkage type of the function-
pointer func. I solved this problem - and now it works - with this
veerryy ugly solution:

extern (C) alias void function() extern_C_void_function_void;
            (you can use another alias-name, but it doesn't matter)
export extern (Windows) void glut???Proc(extern_C_void_function_void);


I tried several other versions like:
-export extern (Windows) void glut???Proc(extern (C) void function())
-export extern (Windows) void glut???Proc(void (C*)())
- ...

but they don't even compile

There has to be another way!
Oct 15 2006