diff --git a/Source/NSString.m b/Source/NSString.m index 562c264a0..9f8c25546 100644 --- a/Source/NSString.m +++ b/Source/NSString.m @@ -3675,6 +3675,10 @@ handle_printf_atsign (FILE *stream, #if HAVE_LIBXML #include +#ifndef __XML_TREE_H__ +static int XML_ELEMENT_NODE; +#endif + static void decodeBase64Unit(const char* ptr, unsigned char *out) { @@ -4270,6 +4274,14 @@ nodeToObject(GSXMLNode* node) static void setupPl() { +#if HAVE_LIBXML +#ifndef __XML_TREE_H__ + /* + * Cache XML node information. + */ + XML_ELEMENT_NODE = [GSXMLNode typeFromDescription: @"XML_ELEMENT_NODE"]; +#endif +#endif plAlloc = (id (*)(id, SEL, NSZone*)) [NSStringClass methodForSelector: @selector(allocWithZone:)]; plInit = (id (*)(id, SEL, unichar*, unsigned))