Blame SOURCES/glibc-rh1505492-undef-15.patch

147e83
commit 439bda3209b768c349b98b8ceecf0fa8d94600e9
147e83
Author: Will Newton <will.newton@linaro.org>
147e83
Date:   Mon Mar 31 15:00:32 2014 +0100
147e83
147e83
    malloc: Fix MALLOC_DEBUG -Wundef warning
147e83
    
147e83
    MALLOC_DEBUG is set optionally on the command line. Default the value
147e83
    to zero if it is not set on the command line, and test its value
147e83
    with #if rather than #ifdef. Verified the code is identical before
147e83
    and after this change apart from line numbers.
147e83
    
147e83
    ChangeLog:
147e83
    
147e83
    2014-04-11  Will Newton  <will.newton@linaro.org>
147e83
    
147e83
            * malloc/malloc.c [!MALLOC_DEBUG]: #define MALLOC_DEBUG
147e83
            to zero if it is not defined elsewhere.  (mtrim): Test
147e83
            the value of MALLOC_DEBUG with #if rather than #ifdef.
147e83
147e83
Conflicts:
147e83
	malloc/malloc.c
147e83
147e83
Resolve whitespace conflict due to malloc reformatting in upstream
147e83
commit 6c8dbf00f536d78b1937b5af6f57be47fd376344.
147e83
147e83
diff --git a/malloc/malloc.c b/malloc/malloc.c
147e83
index 9d3b24ee0c137a1b..3e7b9bf9e8d71247 100644
147e83
--- a/malloc/malloc.c
147e83
+++ b/malloc/malloc.c
147e83
@@ -267,6 +267,10 @@
147e83
   or other mallocs available that do this.
147e83
 */
147e83
 
147e83
+#ifndef MALLOC_DEBUG
147e83
+#define MALLOC_DEBUG 0
147e83
+#endif
147e83
+
147e83
 #ifdef NDEBUG
147e83
 # define assert(expr) ((void) 0)
147e83
 #else
147e83
@@ -4520,7 +4524,7 @@ static int mtrim(mstate av, size_t pad)
147e83
 
147e83
 		if (size > psm1)
147e83
 		  {
147e83
-#ifdef MALLOC_DEBUG
147e83
+#if MALLOC_DEBUG
147e83
 		    /* When debugging we simulate destroying the memory
147e83
 		       content.  */
147e83
 		    memset (paligned_mem, 0x89, size & ~psm1);