digitalmars.D - Attributes problems (any ideas for a fix... maybe []?)
- hellcatv hotmail.com (18/18) May 08 2004 Attributes are pretty good, but they need another form
-
Carlos Santander B.
(35/35)
May 08 2004
wrote in message news:c7k0kq$2vvs$1@digitaldaemon... - hellcatv hotmail.com (7/40) May 09 2004 does that invalidate the next statement for windows?
-
Carlos Santander B.
(19/19)
May 09 2004
wrote in message news:c7l24k$1fj7$1@digitaldaemon... - Vathix (13/31) May 08 2004 attribute.
- Russ Lewis (4/12) May 11 2004 My first thought is to say this looks like a good idea. But my second
Attributes are pretty good, but they need another form I need to be able to do version(UseWindowExports) { [extern (Windows):] }else { [extern (C):] } void glStipple (int, short); right now the colon ends at the next closing brace I want it to survive ONE extra closing brace... or until the next attribute. if I take out the closing brace, then I have to write the glStipple (n) times where n is the number of versions of the lib I want to make can anyone help think of some syntax to fix this..it really makes writing cross-platform headers quite unfeasable the way it is. the language needs ways to make cross-platform headers with different linkages specified on a per-version basis... I can't have gl_sgi.h gl_mac.h gl_windows.h gl_linux.h gl_ppclinux.h(different ABI) --Daniel
May 08 2004
<hellcatv hotmail.com> wrote in message news:c7k0kq$2vvs$1 digitaldaemon.com | Attributes are pretty good, but they need another form | I need to be able to do | | version(UseWindowExports) { | [extern (Windows):] | }else { | [extern (C):] | } | void glStipple (int, short); | | right now the colon ends at the next closing brace | I want it to survive ONE extra closing brace... or until the next attribute. | if I take out the closing brace, then I have to write the glStipple (n) times | where n is the number of versions of the lib I want to make | | can anyone help think of some syntax to fix this..it really makes writing | cross-platform headers quite unfeasable the way it is. | | the language needs ways to make cross-platform headers with different linkages | specified on a per-version basis... I can't have gl_sgi.h gl_mac.h gl_windows.h | gl_linux.h gl_ppclinux.h(different ABI) | | --Daniel You can omit the braces: version(Windows) extern(Windows): else extern(C): ----------------------- Carlos Santander Bernal
May 08 2004
In article <c7k51f$43n$1 digitaldaemon.com>, Carlos Santander B. says...<hellcatv hotmail.com> wrote in message news:c7k0kq$2vvs$1 digitaldaemon.com | Attributes are pretty good, but they need another form | I need to be able to do | | version(UseWindowExports) { | [extern (Windows):] | }else { | [extern (C):] | } | void glStipple (int, short); | | right now the colon ends at the next closing brace | I want it to survive ONE extra closing brace... or until the next attribute. | if I take out the closing brace, then I have to write the glStipple (n) times | where n is the number of versions of the lib I want to make | | can anyone help think of some syntax to fix this..it really makes writing | cross-platform headers quite unfeasable the way it is. | | the language needs ways to make cross-platform headers with different linkages | specified on a per-version basis... I can't have gl_sgi.h gl_mac.h gl_windows.h | gl_linux.h gl_ppclinux.h(different ABI) | | --Daniel You can omit the braces: version(Windows) extern(Windows): else extern(C):does that invalidate the next statement for windows? what if I had export void glEnd(); would that go undefined in the windows version? or does the version command stop on the colon. can I have some dummy statement next?
May 09 2004
<hellcatv hotmail.com> wrote in message news:c7l24k$1fj7$1 digitaldaemon.com | In article <c7k51f$43n$1 digitaldaemon.com>, Carlos Santander B. says... || || You can omit the braces: || version(Windows) || extern(Windows): || else || extern(C): | does that invalidate the next statement for windows? | what if I had | export void glEnd(); | | would that go undefined in the windows version? or does the version command stop | on the colon. | can I have some dummy statement next? I don't think it'll go undefined. However you can try and see what happens. ----------------------- Carlos Santander Bernal
May 09 2004
<hellcatv hotmail.com> wrote in message news:c7k0kq$2vvs$1 digitaldaemon.com...Attributes are pretty good, but they need another form I need to be able to do version(UseWindowExports) { [extern (Windows):] }else { [extern (C):] } void glStipple (int, short); right now the colon ends at the next closing brace I want it to survive ONE extra closing brace... or until the nextattribute.if I take out the closing brace, then I have to write the glStipple (n)timeswhere n is the number of versions of the lib I want to make can anyone help think of some syntax to fix this..it really makes writing cross-platform headers quite unfeasable the way it is. the language needs ways to make cross-platform headers with differentlinkagesspecified on a per-version basis... I can't have gl_sgi.h gl_mac.hgl_windows.hgl_linux.h gl_ppclinux.h(different ABI) --DanielI think something like this would fit in better: version(Something) alias extern(Windows) foo; else alias extern(C) foo; extern(foo): void stuff();
May 08 2004
My first thought is to say this looks like a good idea. But my second thought says that alias is starting to look more and more like a macro language... Vathix wrote:I think something like this would fit in better: version(Something) alias extern(Windows) foo; else alias extern(C) foo; extern(foo): void stuff();
May 11 2004