3 ms·
version (Posix) { version(OSX) { // Weird stuff on OSX } // Sane stuff for Linux or FreeBSD } version (Windows) { // Weird
by Zardoz84 12y ago
version (Posix) {
version(OSX) {
// Weird stuff on OSX
}
// Sane stuff for Linux or FreeBSD
}
version (Windows) {
// Weird stuff for Windows
}
But think that this is processed by the compiler, not by a text pre-processor. Also, you can use your own version stuff, for example here : https://github.com/Zardoz89/nBodySim/blob/master/source/app.d https://github.com/Zardoz89/nBodySim/blob/master/source/app.... there is a "PFor" version to allow to compile a version of the program that uses a parallel foreach (an N Body simulator)