[Issue 3528] New: FreeBSD patches for druntime.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Nov 19 18:41:34 PST 2009


http://d.puremagic.com/issues/show_bug.cgi?id=3528

           Summary: FreeBSD patches for druntime.
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: FreeBSD
            Status: NEW
          Severity: minor
          Priority: P2
         Component: druntime
        AssignedTo: sean at invisibleduck.org
        ReportedBy: boucher.travis at gmail.com


--- Comment #0 from Travis Boucher <boucher.travis at gmail.com> 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: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list