diff --git a/dap-sdk/core/include/dap_common.h b/dap-sdk/core/include/dap_common.h
index 4af92ecc78798a0bdb12c0d486bc4bd7e44eb297..ffdb565ef9668107148cd160b08ad994446e7a1f 100755
--- a/dap-sdk/core/include/dap_common.h
+++ b/dap-sdk/core/include/dap_common.h
@@ -483,6 +483,11 @@ void dap_usleep(time_t a_microseconds);
  */
 char* dap_ctime_r(time_t *a_time, char* a_buf);
 
+static inline void * dap_mempcpy(void * a_dest,const void * a_src,size_t n)
+{
+    return ((byte_t*) memcpy(a_dest,a_src,n))+n;
+}
+
 
 
 #ifdef __MINGW32__
diff --git a/dap-sdk/core/src/dap_fnmatch.c b/dap-sdk/core/src/dap_fnmatch.c
index f89fa536eff2959625980c269d6dd60e5f42d784..f9d70717c69c34dd25c8488d2b7c42e35b11cb49 100644
--- a/dap-sdk/core/src/dap_fnmatch.c
+++ b/dap-sdk/core/src/dap_fnmatch.c
@@ -21,6 +21,8 @@
 #include <string.h>
 #include <stdlib.h>
 #include <stdbool.h>
+
+#include "dap_common.h"
 #include "dap_fnmatch.h"
 
 
@@ -179,7 +181,7 @@ __wcschrnul (const wchar_t *s, wint_t c)
 # endif
 # define STRLEN(S) strlen(S)
 # define STRCAT(D, S) strcat (D, S)
-# define MEMPCPY(D, S, N) mempcpy (D, S, N)
+# define MEMPCPY(D, S, N) dap_mempcpy (D, S, N)
 # define MEMCHR(S, C, N) memchr (S, C, N)
 # define STRCOLL(S1, S2) strcoll (S1, S2)
 # define WIDE_CHAR_VERSION 0
diff --git a/dap-sdk/crypto/src/GOST/block_cipher.c b/dap-sdk/crypto/src/GOST/block_cipher.c
index 93175427f0e22cb99207cc8cf1fec9060090b65b..921d5ae9f781e8d689db7ae3c818e84c7bd6efa8 100644
--- a/dap-sdk/crypto/src/GOST/block_cipher.c
+++ b/dap-sdk/crypto/src/GOST/block_cipher.c
@@ -8,8 +8,6 @@
 #include <memory.h>
 #ifdef __MACH__
 #include <sys/malloc.h>
-#else
-#include <malloc.h>
 #endif
 #include <stdlib.h>