OpenBSD port of dmd?

Martin Nowak dawg at dawgfoto.de
Sat Mar 17 12:10:33 PDT 2012


On Fri, 16 Mar 2012 21:00:47 +0100, Nick Sabalausky <a at a.a> wrote:

> "Martin Nowak" <dawg at dawgfoto.de> wrote in message
> news:op.wa9r9izqsqugbd at localhost...
>> On Fri, 16 Mar 2012 15:53:45 +0100, Andrei Alexandrescu
>> <SeeWebsiteForEmail at erdani.org> wrote:
>>
>>> Just found this, has anyone tried dmd or friends on OpenBSD?
>>>
>>> http://stackoverflow.com/questions/9698581/programming-in-d-for-openbsd
>>>
>> OpenBSD would need some druntime work.
>
> Do you have anything in particular in mind?
>
Porting any POSIX/ELF OS should be very simple.

- add OS detection to makefiles
- add in OS specific struct layouts in core.sys (ucontext_t, siginfo_t,  
sockaddr...)
- add rt.memory functions, using the linker script to find static segment  
brackets


We use the following pattern all over the place.

version (Windows) {}
else version (OSX) {}
else version (linux) {}
else version (FreeBSD) {}
else static assert(0);

For anything but struct layouts the following would be correct.

version (Windows) {}
else version (linux, OSX) {} // iff specialized
else version (POSIX) {}
else static assert(0);

Because of this you'll need to change core.{thread...} and dmd as well.

I'm not stepping into the discussion below but I don't see the point of
differencing FreeBSD, NetBSD, OpenBSD, DragonFlyBSD, Darwin, Solaris,  
OpenIndiana...
After all that's what POSIX was made for.

Have a look at core.sync.mutex which will work on all of these platforms.


More information about the Digitalmars-d mailing list