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);