blob: 9afe2d7afbbab7dd026a440ff282b409fa48f42c [file] [log] [blame]
--- newlib-1.20.0/newlib/libc/stdlib/mallocr.c 2010-05-31 12:15:41.000000000 -0700
+++ newlib-1.20.0-new/newlib/libc/stdlib/mallocr.c 2013-05-02 12:03:25.831542637 -0700
@@ -303,13 +303,22 @@
#include <reent.h>
+#ifndef MALLOC_LOCK_FUNCTION
+#define MALLOC_LOCK_FUNCTION __malloc_lock
+#endif
+
+#ifndef MALLOC_UNLOCK_FUNCTION
+#define MALLOC_UNLOCK_FUNCTION __malloc_unlock
+#endif
+
#define POINTER_UINT unsigned _POINTER_INT
#define SEPARATE_OBJECTS
#define HAVE_MMAP 0
#define MORECORE(size) _sbrk_r(reent_ptr, (size))
#define MORECORE_CLEARS 0
-#define MALLOC_LOCK __malloc_lock(reent_ptr)
-#define MALLOC_UNLOCK __malloc_unlock(reent_ptr)
+
+#define MALLOC_LOCK MALLOC_LOCK_FUNCTION(reent_ptr)
+#define MALLOC_UNLOCK MALLOC_UNLOCK_FUNCTION(reent_ptr)
#ifdef __CYGWIN__
# undef _WIN32
@@ -325,11 +334,11 @@
#endif
#if __STD_C
-extern void __malloc_lock(struct _reent *);
-extern void __malloc_unlock(struct _reent *);
+extern void MALLOC_LOCK_FUNCTION(struct _reent *);
+extern void MALLOC_UNLOCK_FUNCTION(struct _reent *);
#else
-extern void __malloc_lock();
-extern void __malloc_unlock();
+extern void MALLOC_LOCK_FUNCTION();
+extern void MALLOC_UNLOCK_FUNCTION();
#endif
#if __STD_C