Confusion over version (xxx)

Ken Barry kb9888 at gmail.com
Fri Aug 15 00:51:15 PDT 2008


Just learning D, working with GLFW and dmd 1.030 on WinXP. The files glfw.d, gl.d and glu.d shipped with the GLFW distribution contain the following...

version (Win32) {
    extern (Windows):
}
version (linux) {
    extern (C):
}

...which results in Symbol Undefined errors.
One of the files contains a variation...

version(Win32)
   extern(Windows):
else
   extern(C):

...which results in a syntax error on the 'else'.
I have tried all the variations I can think of, such as

version(Win32)
{
   extern(Windows):
}
else
{
   extern(C):
}

which also results in Symbol Undefined errors.
The only thing that works is...

version(Win32):

...on it's own. So I'm confused and would really appreciate it if anyone can explain this behaviour.


More information about the Digitalmars-d-learn mailing list