From 4574ec75d8d7ea3f54b8b41ce10ed9c19d87caea Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Fri, 17 Dec 2004 14:02:54 +0000 Subject: [PATCH] Implement strdup for MPW --- ChangeLog | 2 ++ misc/strutil.c | 14 +++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d8857613..430d2345 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,8 @@ * 2d/font.c, 3d/rod.c: fix compiler errors in MPW w/o OpenGL + * misc/strutil.c: Implement strdup for MPW + 2004-12-07 Chris Taylor * 2d/font.c: Initialise the dataptr member correctly. diff --git a/misc/strutil.c b/misc/strutil.c index 93333a2c..91cdc6bb 100644 --- a/misc/strutil.c +++ b/misc/strutil.c @@ -1,4 +1,4 @@ -/* $Id: strutil.c,v 1.12 2004-12-03 18:39:20 schaffner Exp $ */ +/* $Id: strutil.c,v 1.13 2004-12-17 14:02:54 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -25,6 +25,18 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include "error.h" #ifdef macintosh +# if defined(NDEBUG) +char *strdup(const char *str) +{ + char *newstr; + + newstr = malloc(strlen(str) + 1); + strcpy(newstr, str); + + return newstr; +} +# endif // NDEBUG + // string compare without regard to case int stricmp( const char *s1, const char *s2 ) -- 2.39.2