From 6cb034a64921556a13c620fda7257a0f9f7260ba Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Sun, 19 Jan 2020 10:57:16 -0500 Subject: [PATCH] Expose SDL_memcpy --- src/SDL2.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/SDL2.cs b/src/SDL2.cs index a15a556..46c290c 100644 --- a/src/SDL2.cs +++ b/src/SDL2.cs @@ -131,6 +131,14 @@ namespace SDL2 [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] internal static extern void SDL_free(IntPtr memblock); + /* Buffer.BlockCopy is not available in every runtime yet. Also, + * using memcpy directly can be a compatibility issue in other + * strange ways. So, we expose this to get around all that. + * -flibit + */ + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr SDL_memcpy(IntPtr dst, IntPtr src, IntPtr len); + #endregion #region SDL_rwops.h