[PATCH 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
KrimtonZ
krimtonz@gmail.com
Wed Jan 22 16:26:00 GMT 2020
---
newlib/libc/include/sys/reent.h | 2 +-
newlib/libc/stdlib/mprec.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
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; \
})
--
2.17.1
More information about the Newlib
mailing list