Really fix the build.

libcutils/mspace.c includes libc/bionic/dlmalloc.c, we need to
take care of the fact that any internal C library function cannot
be used from it.

Change-Id: I0bc81ae090b7ac2d464f26b97fc6b94a08cdad9c
diff --git a/libc/Android.mk b/libc/Android.mk
index f59fe43..dfbd57b 100644
--- a/libc/Android.mk
+++ b/libc/Android.mk
@@ -479,7 +479,8 @@
 		-DINET6 \
 		-I$(LOCAL_PATH)/private \
 		-DUSE_DL_PREFIX \
-		-DPOSIX_MISTAKE
+		-DPOSIX_MISTAKE \
+                -DLOG_ON_HEAP_ERROR \
 
 # these macro definitions are required to implement the
 # 'timezone' and 'daylight' global variables, as well as
diff --git a/libc/bionic/dlmalloc.c b/libc/bionic/dlmalloc.c
index 9aab1b7..8c75e9c 100644
--- a/libc/bionic/dlmalloc.c
+++ b/libc/bionic/dlmalloc.c
@@ -2270,7 +2270,7 @@
  * was detected. We need to be careful about not using a log function
  * that may require an allocation here!
  */
-#ifdef __ANDROID__
+#ifdef LOG_ON_HEAP_ERROR
 
 #  include <private/logd.h>
 
@@ -2300,7 +2300,7 @@
     __bionic_heap_error("INVALID HEAP ADDRESS", __FUNCTION__)
 #  endif
 
-#else /* !__ANDROID__ */
+#else /* !LOG_ON_HEAP_ERROR */
 
 #  ifndef CORRUPTION_ERROR_ACTION
 #    define CORRUPTION_ERROR_ACTION(m) ABORT
@@ -2310,7 +2310,7 @@
 #    define USAGE_ERROR_ACTION(m,p) ABORT
 #  endif /* USAGE_ERROR_ACTION */
 
-#endif /* !__ANDROID__ */
+#endif /* !LOG_ON_HEAP_ERROR */
 
 
 #endif /* PROCEED_ON_ERROR */