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

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