Re: Question about version ( ) keyword

2016-03-23 Thread Nick Treleaven via Digitalmars-d
On Monday, 21 March 2016 at 14:51:48 UTC, Vincent R wrote: version( CRuntime_Glibc ) || version( FreeBSD ) || version (Solaris) { As a workaround, you can do it with static if and version strings: http://forum.dlang.org/post/op.vkshabecot0hzo@las-miodowy

Re: Question about version ( ) keyword

2016-03-22 Thread Chris Wright via Digitalmars-d
On Mon, 21 Mar 2016 15:01:27 +, Adam D. Ruppe wrote: > On Monday, 21 March 2016 at 14:51:48 UTC, Vincent R wrote: >> However I understand that this limitation allow a clear separation >> between different platforms... > > That's exactly why it is done this way, so the platforms are clearly >

Re: Question about version ( ) keyword

2016-03-21 Thread Daniel Kozak via Digitalmars-d
Dne 21.3.2016 v 15:51 Vincent R via Digitalmars-d napsal(a): Hi, When looking at core definitions like core.sys.posix.pthread I can see some "duplicated" code because it seems version doesn't support Or as we would do in C/C++ with #ifdefined. For instance if can read this: version(

Re: Question about version ( ) keyword

2016-03-21 Thread Daniel Kozak via Digitalmars-d
Dne 21.3.2016 v 18:18 Kagamin via Digitalmars-d napsal(a): On Monday, 21 March 2016 at 14:51:48 UTC, Vincent R wrote: When I see this code I cannot help thinking of something like: version( CRuntime_Glibc ) || version( FreeBSD ) || version (Solaris) { if(version(Solaris)) enum

Re: Question about version ( ) keyword

2016-03-21 Thread Kagamin via Digitalmars-d
On Monday, 21 March 2016 at 14:51:48 UTC, Vincent R wrote: When I see this code I cannot help thinking of something like: version( CRuntime_Glibc ) || version( FreeBSD ) || version (Solaris) { if(version(Solaris)) enum PTHREAD_BARRIER_SERIAL_THREAD = -2; else

Re: Question about version ( ) keyword

2016-03-21 Thread Joakim via Digitalmars-d
On Monday, 21 March 2016 at 14:51:48 UTC, Vincent R wrote: Hi, When looking at core definitions like core.sys.posix.pthread I can see some "duplicated" code because it seems version doesn't support Or as we would do in C/C++ with #ifdefined. For instance if can read this: [...] The

Re: Question about version ( ) keyword

2016-03-21 Thread Adam D. Ruppe via Digitalmars-d
On Monday, 21 March 2016 at 14:51:48 UTC, Vincent R wrote: However I understand that this limitation allow a clear separation between different platforms... That's exactly why it is done this way, so the platforms are clearly separated from each other and always grouped together for

Question about version ( ) keyword

2016-03-21 Thread Vincent R via Digitalmars-d
Hi, When looking at core definitions like core.sys.posix.pthread I can see some "duplicated" code because it seems version doesn't support Or as we would do in C/C++ with #ifdefined. For instance if can read this: version( CRuntime_Glibc ) { enum PTHREAD_BARRIER_SERIAL_THREAD = -1;