Browse Source

Added P/Invoke helpers for unmanaged-unmanaged memory copies.

pull/45/merge
triton 13 years ago
parent
commit
3f93eb4b0e
  1. 3
      build/premake4.lua
  2. 15
      src/Runtime/Helpers.cs

3
build/premake4.lua

@ -27,6 +27,9 @@ solution "CppSharp" @@ -27,6 +27,9 @@ solution "CppSharp"
configuration "vs2012"
framework "4.0"
configuration "windows"
defines { "WINDOWS" }
configuration {}
group "Examples"

15
src/Runtime/Helpers.cs

@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
using System;
using System.Runtime.InteropServices;
namespace CppSharp.Runtime
{
public static class Helpers
{
#if WINDOWS
[DllImport("msvcrt.dll", EntryPoint = "memcpy", CallingConvention = CallingConvention.Cdecl)]
#else
[DllImport("libc", EntryPoint = "memcpy")]
#endif
public static extern IntPtr memcpy(IntPtr dest, IntPtr src, UIntPtr count);
}
}
Loading…
Cancel
Save