Visual C++: Fixed compiler error for "strdup"

This commit is contained in:
Daniel Marjamäki 2008-11-07 16:20:22 +00:00
parent 34f44e3c04
commit af5b1858aa
1 changed files with 9 additions and 1 deletions

View File

@ -44,7 +44,15 @@ public:
{ free(_str); } { free(_str); }
void setstr( const char s[] ) void setstr( const char s[] )
{ free(_str); _str = strdup(s); str = _str ? _str : ""; } {
free(_str);
#ifndef _MSC_VER
_str = strdup(s);
#else
_str = _strdup(s);
#endif
str = _str ? _str : "";
}
const char *str; const char *str;