On Mar 8, 2014 9:40 AM, "Johannes Pfau" <nospam@example.com> wrote:
>
> Am Sat, 08 Mar 2014 09:12:48 +0000
> schrieb "Mike" <none@none.com>:
>
> > On Saturday, 8 March 2014 at 08:09:29 UTC, Timo Sintonen wrote:
> > >
> > > Why do you need synchronized? Are you building some kind of
> > > multithreading library?
> >
> > I don't need it yet.  I'm just exploring features of D and trying
> > to learn how to implement them.  The real problem isn't that I
> > can't use synchronized, but rather that the compiler is not aware
> > of my target.  I haven't searched through GDC's source code yet,
> > but I suspect there will be more problems in the near future if
> > the compiler is not taught about this target.
> >
> > Mike
> >
>
> critsecsize looks like a perfect example for configuration parameters
> which should be provided by the runtime.
>
> I'm thinking of a core/config.d module which can be read by the
> compiler to get information about the runtime:
> ------------
> enum critsecsize = 4;
> enum hasGC = true;
> enum hasAArray = true;
> enum hasUnicodeLoops = true;
> enum hasExceptions = true;
> enum ...
> ------------
>
> I wouldn't be too worried about 'isLinux' in general. Iain moved many
> of these checks out of the frontend IIRC and rewrote them as checks
> using Target::. In the end isLinux is just not the correct check if you
> want to know the critsecsize/used ABI/...
>
> grep isLinux */* shows that the only place in GDC where it's ever used
> is critsecsize.
> If you grep for isWindows you'll see that these checks are DMD-only and
> GDC already avoids them. (isWindows affects extern(System) but that's
> fine). It's similar for in the other cases.
>

I thought I might just also add that it is a mid to long term goal to remove isLinux and friends out of the dfrontend and into target.c in upstream dmd.  When this is ready, then we can pull all use setting/getting isLinux and friends out of GDC.

Regards
--
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';