attribute decl in version decl

Timon Gehr timon.gehr at gmx.ch
Sun Sep 18 11:02:45 PDT 2011


On 09/18/2011 06:55 PM, Ellery Newcomer wrote:
> Just came across some old D code that does this:
>
> version(linux){
> 	extern(C):
> }
>
> <Hundreds of OpenGL decls>
>
>
>
> in dmd 2.055, the extern(C) is not being applied to the OpenGL decls.
> should it?

Yes they should be applied, unless they declare D functions, which is 
seldom the case for <Hundreds of OpenGL decls>.

If you are asking, if the D compiler is wrong here: No, it is by design, 
you can check with the D grammar.


More information about the Digitalmars-d-learn mailing list