Browse Source

Fix build errors that pop up in VS/ mcs master

pull/1/head
Alex Corrado 14 years ago
parent
commit
33416d2b0a
  1. 6
      src/Mono.Cxxi/CppInstancePtr.cs
  2. 8
      tests/Tests.csproj

6
src/Mono.Cxxi/CppInstancePtr.cs

@ -70,7 +70,6 @@ namespace Mono.Cxxi { @@ -70,7 +70,6 @@ namespace Mono.Cxxi {
}
// Alloc a new C++ instance
// NOTE: native_vtptr will be set later after native ctor is called
internal CppInstancePtr (int nativeSize, object managedWrapper)
{
// Under the hood, we're secretly subclassing this C++ class to store a
@ -78,6 +77,9 @@ namespace Mono.Cxxi { @@ -78,6 +77,9 @@ namespace Mono.Cxxi {
int allocSize = nativeSize + Marshal.SizeOf (typeof (IntPtr));
ptr = Marshal.AllocHGlobal (allocSize);
// NOTE: native_vtptr will be set later after native ctor is called
native_vtptr = IntPtr.Zero;
// zero memory for sanity
// FIXME: This should be an initblk
byte[] zeroArray = new byte [allocSize];
@ -93,6 +95,7 @@ namespace Mono.Cxxi { @@ -93,6 +95,7 @@ namespace Mono.Cxxi {
internal CppInstancePtr (int nativeSize)
{
ptr = Marshal.AllocHGlobal (nativeSize);
native_vtptr = IntPtr.Zero;
manage_memory = true;
}
@ -103,6 +106,7 @@ namespace Mono.Cxxi { @@ -103,6 +106,7 @@ namespace Mono.Cxxi {
throw new ArgumentOutOfRangeException ("native cannot be null pointer");
ptr = native;
native_vtptr = IntPtr.Zero;
manage_memory = false;
}

8
tests/Tests.csproj

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@ -90,7 +90,9 @@ @@ -90,7 +90,9 @@
</MonoDevelop>
</ProjectExtensions>
<ItemGroup>
<Reference Include="nunit.framework, Version=2.4.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77" />
<Reference Include="nunit.framework, Version=2.4.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
@ -103,4 +105,4 @@ @@ -103,4 +105,4 @@
<Name>generator</Name>
</ProjectReference>
</ItemGroup>
</Project>
</Project>
Loading…
Cancel
Save