https://issues.dlang.org/show_bug.cgi?id=7417
Witold Baryluk <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #6 from Witold Baryluk <[email protected]> --- Hi. Any update on this. I was just trying to compiled phobos using gdc on arm64, and of course first thing that failed was a static assert in libdruntime/core/sys/posix/sys/socket.d that do have about 10 different semi duplicated version branches. I would really want to say: version (ARM || AArch64 || PPC || PPC64 || MIPS32 || MIPS64 || X86 || X86_64) { ... } else version (SomethingSpecial) { ... } else { static assert(0); } That would be good enough in most cases. Support for more elaborate conditions would be nice too. instead of version (A) { } else { somethign special. } version (!A) { something special. } or version (A) { version (B) { something. } } version (A && B) { something. } It is probably possible to implement what I want using mixing and putting common code in the template, and then expand version (ARM || AArch64 || PPC || PPC64 || MIPS32 || MIPS64 || X86 || X86_64) { into separate branches with mixed-in template. Still I fell, explicit booleans support on versions would be nicer. BTW. The mentioned file also shows almost the same enums in the OSX and FreeBSD branches, so maybe in this case it is worth doing this via mixin, as the OSX and FreeBSD branches cannot be really folded easily into one version (OSX || FreeBSD) branch. Same with Android (with do have same enum values as Linux). --
