olga / rpms / glibc

Forked from rpms/glibc 5 years ago
Clone

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

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