Browse Source

Fix build errors that pop up in VS/ mcs master

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

6
src/Mono.Cxxi/CppInstancePtr.cs

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

6
tests/Tests.csproj

@ -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"> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@ -90,7 +90,9 @@
</MonoDevelop> </MonoDevelop>
</ProjectExtensions> </ProjectExtensions>
<ItemGroup> <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" /> <Reference Include="System" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

Loading…
Cancel
Save