From 1ceb6ece223d811bc3b3d994945ae004bc57e5bf Mon Sep 17 00:00:00 2001 From: "beard%netscape.com" Date: Sun, 4 Apr 1999 01:20:34 +0000 Subject: [PATCH] Added a strdup function for XP_MAC. --- xpcom/libxpt/src/xpt_struct.c | 12 ++++++++++++ xpcom/typelib/xpt/src/xpt_struct.c | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/xpcom/libxpt/src/xpt_struct.c b/xpcom/libxpt/src/xpt_struct.c index 6e0f70f995a..5b6d282aff9 100644 --- a/xpcom/libxpt/src/xpt_struct.c +++ b/xpcom/libxpt/src/xpt_struct.c @@ -22,6 +22,18 @@ #include "xpt_struct.h" #include +#ifdef XP_MAC +static char *strdup(const char *c) +{ + char *newStr = malloc(strlen(c) + 1); + if (newStr) + { + strcpy(newStr, c); + } + return newStr; +} +#endif + static PRBool DoInterfaceDirectoryEntry(XPTCursor *cursor, XPTInterfaceDirectoryEntry *ide, uint16 index); diff --git a/xpcom/typelib/xpt/src/xpt_struct.c b/xpcom/typelib/xpt/src/xpt_struct.c index 6e0f70f995a..5b6d282aff9 100644 --- a/xpcom/typelib/xpt/src/xpt_struct.c +++ b/xpcom/typelib/xpt/src/xpt_struct.c @@ -22,6 +22,18 @@ #include "xpt_struct.h" #include +#ifdef XP_MAC +static char *strdup(const char *c) +{ + char *newStr = malloc(strlen(c) + 1); + if (newStr) + { + strcpy(newStr, c); + } + return newStr; +} +#endif + static PRBool DoInterfaceDirectoryEntry(XPTCursor *cursor, XPTInterfaceDirectoryEntry *ide, uint16 index);