[1/1] change forced use of __assert_func to use the assert macro in reent.h and mprec.h, this honors the use of -DNDEBUG to not use assertion

Message ID 20200122162628.19385-2-krimtonz@gmail.com
State New
Headers show
Series
  • replace forced __assert_func with assert macro
Related show

Commit Message

KrimtonZ Jan. 22, 2020, 4:26 p.m.
---
 newlib/libc/include/sys/reent.h | 2 +-
 newlib/libc/stdlib/mprec.h      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

-- 
2.17.1

Patch

diff --git a/newlib/libc/include/sys/reent.h b/newlib/libc/include/sys/reent.h
index 74b70e9c0..2d561453f 100644
--- a/newlib/libc/include/sys/reent.h
+++ b/newlib/libc/include/sys/reent.h
@@ -501,7 +501,7 @@  extern const struct __sFILE_fake __sf_fake_stderr;
 /* Specify how to handle reent_check malloc failures. */
 #ifdef _REENT_CHECK_VERIFY
 #include <assert.h>
-#define __reent_assert(x) ((x) ? (void)0 : __assert_func(__FILE__, __LINE__, (char *)0, "REENT malloc succeeded"))
+#define __reent_assert(x) ((x) ? (void)0 : assert("REENT malloc succeeded"))
 #else
 #define __reent_assert(x) ((void)0)
 #endif
diff --git a/newlib/libc/stdlib/mprec.h b/newlib/libc/stdlib/mprec.h
index a1492aa38..595f485d4 100644
--- a/newlib/libc/stdlib/mprec.h
+++ b/newlib/libc/stdlib/mprec.h
@@ -344,7 +344,7 @@  typedef struct _Bigint _Bigint;
 #define eBalloc(__reent_ptr, __len) ({ \
    void *__ptr = Balloc(__reent_ptr, __len); \
    if (__ptr == NULL) \
-     __assert_func(__FILE__, __LINE__, (char *)0, "Balloc succeeded"); \
+     assert("Balloc succeeded"); \
    __ptr; \
    })