Re: attribute decl in version decl

2011-09-19 Thread Timon Gehr
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

Re: attribute decl in version decl

2011-09-19 Thread Ellery Newcomer
On 09/18/2011 01:02 PM, Timon Gehr wrote: If you are asking, if the D compiler is wrong here: No, it is by design, you can check with the D grammar. Nah, just confirming that failure to apply the externs is a bug.

Re: attribute decl in version decl

2011-09-19 Thread Timon Gehr
On 09/18/2011 10:46 PM, Ellery Newcomer wrote: On 09/18/2011 01:02 PM, Timon Gehr wrote: If you are asking, if the D compiler is wrong here: No, it is by design, you can check with the D grammar. Nah, just confirming that failure to apply the externs is a bug. version(linux){

Re: attribute decl in version decl

2011-09-19 Thread Ellery Newcomer
On 09/18/2011 04:09 PM, Trass3r wrote: Am 18.09.2011, 18:55 Uhr, schrieb Ellery Newcomer ellery-newco...@utulsa.edu: 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

Re: attribute decl in version decl

2011-09-19 Thread Trass3r
Am 18.09.2011, 18:55 Uhr, schrieb Ellery Newcomer ellery-newco...@utulsa.edu: 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? Walter once said

Re: attribute decl in version decl

2011-09-19 Thread Daniel Murphy
Ellery Newcomer ellery-newco...@utulsa.edu wrote in message news:j557r6$vgt$1...@digitalmars.com... Just came across some old D code that does this: version(linux){ extern(C): } Are the prototypes extern(Windows) when not on linux, by any chance? That is the only combination I've ever

Re: attribute decl in version decl

2011-09-19 Thread Mike Parker
On 9/19/2011 1:55 AM, 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? Change it to the following, and you're golden.

Re: attribute decl in version decl

2011-09-19 Thread Trass3r
Change it to the following, and you're golden. extern(System): Hundreds of OpenGL decls That only fixes this particular issue. I once had the following case that can't be done: version(V1) { extern(System): } else { extern(C): }

Re: attribute decl in version decl

2011-09-19 Thread Timon Gehr
On 09/19/2011 03:37 PM, Trass3r wrote: Change it to the following, and you're golden. extern(System): Hundreds of OpenGL decls That only fixes this particular issue. I once had the following case that can't be done: version(V1) { extern(System): } else { extern(C): } You could use the C

Re: attribute decl in version decl

2011-09-19 Thread Ellery Newcomer
On 09/18/2011 11:04 PM, Daniel Murphy wrote: Ellery Newcomer ellery-newco...@utulsa.edu wrote in message news:j557r6$vgt$1...@digitalmars.com... Just came across some old D code that does this: version(linux){ extern(C): } Are the prototypes extern(Windows) when not on linux, by any

Re: attribute decl in version decl

2011-09-19 Thread Ellery Newcomer
On 09/19/2011 08:59 AM, Timon Gehr wrote: You could use the C preprocessor ;). Or this, that does the same thing: version(V1) private enum _v1=true; else private enum _v1=false; mixin((_v1?extern(System)::extern(C):)~q{ // all declarations that should be affected. }); code golf or