From aa92d9c1f8299ef2d8dee0f630ea349529f00fff Mon Sep 17 00:00:00 2001
From: "Kevin P. Fleming" <kpfleming@digium.com>
Date: Wed, 14 Sep 2005 02:30:33 +0000
Subject: [PATCH] don't double define our own string functions on platforms
 that don't have them (issue #5169)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6587 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 astmm.c                    | 1 -
 include/asterisk/strings.h | 4 ++--
 utils.c                    | 4 ++--
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/astmm.c b/astmm.c
index c3ec2b6444..6087f7ff68 100755
--- a/astmm.c
+++ b/astmm.c
@@ -13,7 +13,6 @@
 
 #ifdef __AST_DEBUG_MALLOC
 
-#include <malloc.h>
 #include <stdio.h>
 #include <string.h>
 #include <time.h>
diff --git a/include/asterisk/strings.h b/include/asterisk/strings.h
index 37a5faccdb..e0e5148a3f 100755
--- a/include/asterisk/strings.h
+++ b/include/asterisk/strings.h
@@ -214,7 +214,7 @@ struct ast_realloca {
 char *strcasestr(const char *, const char *);
 #endif
 
-#ifndef HAVE_STRNDUP
+#if !defined(HAVE_STRNDUP) && !defined(__AST_DEBUG_MALLOC)
 char *strndup(const char *, size_t);
 #endif
 
@@ -222,7 +222,7 @@ char *strndup(const char *, size_t);
 size_t strnlen(const char *, size_t);
 #endif
 
-#ifndef HAVE_VASPRINTF
+#if !defined(HAVE_VASPRINTF) && !defined(__AST_DEBUG_MALLOC)
 int vasprintf(char **strp, const char *fmt, va_list ap);
 #endif
 
diff --git a/utils.c b/utils.c
index 282c2e18ea..a3423b8051 100755
--- a/utils.c
+++ b/utils.c
@@ -658,7 +658,7 @@ size_t strnlen(const char *s, size_t n)
 }
 #endif
 
-#ifndef HAVE_STRNDUP
+#if !defined(HAVE_STRNDUP) && !defined(__AST_DEBUG_MALLOC)
 char *strndup(const char *s, size_t n)
 {
 	size_t len = strnlen(s, n);
@@ -672,7 +672,7 @@ char *strndup(const char *s, size_t n)
 }
 #endif
 
-#ifndef HAVE_VASPRINTF
+#if !defined(HAVE_VASPRINTF) && !defined(__AST_DEBUG_MALLOC)
 int vasprintf(char **strp, const char *fmt, va_list ap)
 {
 	int size;
-- 
GitLab