1
D / DSFML and D1
« on: December 08, 2010, 09:19:22 am »
Example of use
Code: [Select]
// D import file generated from 'derelict/util/compat.d'
module derelict.util.compat;
version (D_Version2){
mixin("alias const(char)* CCPTR;");
mixin("alias const(wchar)* CWCPTR;");
mixin("alias const(dchar)* CDCPTR;");
mixin("alias const(ubyte)* CUBPTR;");
mixin("alias const(void)* CVPTR;");
mixin("alias immutable(char)* ICPTR;");
}
else{
alias char* CCPTR;
alias wchar* CWCPTR;
alias dchar* CDCPTR;
alias ubyte* CUBPTR;
alias void* CVPTR;
alias char* ICPTR;
}
version (Tango){
private
{
import tango.stdc.string;
import tango.stdc.stringz;
import tango.text.Util;
import tango.core.Version;
}
version (PhobosCompatibility){
}
else{
alias char[] string;
alias wchar[] wstring;
alias dchar[] dstring;
}
}
else{
private {
version (D_Version2){
import std.conv;
}
import std.string;
import std.c.string;
}
}
template gsharedString(){
version (D_Version2){
const gsharedString = "__gshared: ";
}
else{
const gsharedString = "";
}
}