Summary: FreeBSD patches for druntime.
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: FreeBSD
            Status: NEW
          Severity: minor
          Priority: P2
         Component: druntime

--- Comment #0 from Travis Boucher <> 2009-11-19 
18:41:32 PST ---
Created an attachment (id=503)
FreeBSD quick fix (should compile, may not work properly)

This is a preliminary patch, mostly trivial, and not fully tested yet (but it
compiles, so that is 1 step in the right direction).

Some notes:

- posix.mak implies posix which also implies unix line termination.  This patch
doesn't have it corrected.  A simple  perl -pi -e 's/\r\n/\n/g' filename   will
convert from winderz to unix line termination.   Note a biggy, just something I
trip over sometimes when making patches.

- dmd2 changed freebsd to FreeBSD for version statements.  Maybe version
statements should case insensitive?

- For the most part I just copied the linux definitions of stuff that was
missing.  This may or may not work, I don't have everything ready to run a good
test yet.

- make is only gnu make on linux machines.  I'd like to make the whole build
structure a little more standard make-wise.  The dmd source is pretty good for
this.  I am not sure what druntime needs that is so gnu specific.

Future direction:

Cleanup the whole runtime and group Posix vs. Linux/FreeBSD definitions
properly.  Stuff that is defined in the Posix spec should be in a version(
Posix ) rather then a version( linux ) with duplicates for version( FreeBSD ),
version( Solaris ), version( each other os).

I'd prefer to see something like this:

version (Posix) {
  struct OSStructure {
     version(linux) int foo;
     version(FreeBSD) long foo;
     int bar;

for trivial differences between implementations rather then a completely
different block.  This is even more important for things like standard posix
APIs.  Another example is when one implementation uses a macro and another uses
a function.

version (FreeBSD) {
   void MacroImplementation(...) { ... }
   alias MacroImplementaion DImplementaion

version (linux) {
  extern (C) void LibraryImplementation(...) { ... }
  alias LibraryImplementaion DImplementation

(I think some of the pthread stuff is like this, but I have to read through
both source trees to find out for sure).

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to