Closed etcimon closed 10 years ago
They are parsed but grayed out.
Why gray them out?
To let people see that these code regions aren't active yet.
Let's say I'm developing under Mac OS X, shouldn't version(OSX) be active?
sure, I'm trying to fix it
Oh, great I thought you were saying it shouldn't be =)
https://github.com/aBothe/D_Parser/blob/master/DParser2/Misc/VersionIdEvaluation.cs#L38 Although I'd expect it to work on OSX. Could you try to put in a breakpoint at that position?
Hmm, would that be with gdb? I've never really tried debugging C# on a Mac
nope, directly inside XS
Um, so I clone the repo and compile it in XS?
Oh look, apparently Mac returns Unix on a call to Environment.OSVersion.Platform
Here's something
//From Managed.Windows.Forms/XplatUI
[DllImport ("libc")]
static extern int uname (IntPtr buf);
static bool IsRunningOnMac ()
{
IntPtr buf = IntPtr.Zero;
try {
buf = Marshal.AllocHGlobal (8192);
// This is a hacktastic way of getting sysname from uname ()
if (uname (buf) == 0) {
string os = Marshal.PtrToStringAnsi (buf);
if (os == "Darwin")
return true;
}
} catch {
} finally {
if (buf != IntPtr.Zero)
Marshal.FreeHGlobal (buf);
}
return false;
}
static bool IsRunningOnFreeBSD ()
{
IntPtr buf = IntPtr.Zero;
try {
buf = Marshal.AllocHGlobal (8192);
// This is a hacktastic way of getting sysname from uname ()
if (uname (buf) == 0) {
string os = Marshal.PtrToStringAnsi (buf);
if (os == "FreeBSD")
return true;
}
} catch {
} finally {
if (buf != IntPtr.Zero)
Marshal.FreeHGlobal (buf);
}
return false;
}
You might want to use uname() to find FreeBSD as well
Not yet. I'll wait until someone actually uses MD under FreeBSD. Or did you? :P
Heh, I was using it but it's the worst UI I've ever seen, I'll develop kqueue under mac instead
:-D
Both platforms are unrecognized by Mono-D and do not parse the codes under version(OSX) or version(FreeBSD)