retVal = PosTest2() && retVal;
retVal = PosTest3() && retVal;
}
-#if !WinCoreSys
else
{
- retVal = PosMacTest1() && retVal;
+ retVal = PosNonWinTest1() && retVal;
}
-#endif
+
return retVal;
}
return retVal;
}
-#if !WinCoreSys
- public bool PosMacTest1()
+ public bool PosNonWinTest1()
{
bool retVal = true;
string pwd = null;
try
{
- pwd = getenv("PWD");
+ pwd = Marshal.PtrToStringUni(getenv("PWD"));
if (Marshal.GetLastWin32Error() != 0)
{
return retVal;
}
-#endif
#endregion
#endregion
#region Private Methods
-#if !WinCoreSys
[SecurityCritical]
- [DllImport("/usr/lib/libc.dylib")]
- private static extern string getenv(string key);
-#endif
+ [DllImport("libc")]
+ private static extern IntPtr getenv(string key);
[DllImport("kernel32.dll", SetLastError = true)]
private extern static void SetLastError(uint dwErrCode);
#endregion
#region Macintosh P/invoke Declarations
- [DllImport("libc.dylib")]
+ [DllImport("libc")]
private static extern IntPtr malloc(uint siz);
- [DllImport("libc.dylib")]
+ [DllImport("libc")]
private static extern void free(IntPtr ptr);
#endregion