extern linkage: function pointer syntax

LW leo at clw-online.de
Sun Oct 15 09:21:04 PDT 2006

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!

More information about the Digitalmars-d-learn mailing list