mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
Fix for xml on mingw32
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20736 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
7308c55778
commit
bfe4ac4b9c
2 changed files with 13 additions and 1 deletions
|
@ -124,12 +124,21 @@ static BOOL cacheDone = NO;
|
|||
@end
|
||||
#endif
|
||||
|
||||
static char * objc_strdup(const char *from)
|
||||
{
|
||||
unsigned len = (from == 0) ? 1 : (strlen(from) + 1);
|
||||
char *to = objc_malloc(len);
|
||||
strcpy(to, from);
|
||||
return to;
|
||||
}
|
||||
|
||||
static void
|
||||
setupCache()
|
||||
{
|
||||
if (cacheDone == NO)
|
||||
{
|
||||
cacheDone = YES;
|
||||
xmlMemSetup(objc_free, objc_malloc, objc_realloc, objc_strdup);
|
||||
|
||||
#if HAVE_LIBXML_SAX2_H
|
||||
xmlDefaultSAXHandlerInit();
|
||||
|
@ -376,7 +385,7 @@ static NSMapTable *attrNames = 0;
|
|||
if (buf != 0 && length > 0)
|
||||
{
|
||||
string = UTF8StrLen(buf, length);
|
||||
xmlFree(buf);
|
||||
objc_free(buf);
|
||||
}
|
||||
return string;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue