I use this: http://dpaste.com/13HWHT0 This is posix version for ldc 1.4, no -betterC, not sure if it compiles with -betterC. Runtime was compiler specific until recently, not sure if it was fixed.