Skip to content

Commit dfb2d54

Browse files
authored
Merge pull request #4699 from bnbarham/fix-const
Fix incompatible function pointer type
2 parents 28b2f25 + 5ccd609 commit dfb2d54

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

CoreFoundation/Parsing.subproj/CFXMLInterface.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,7 +1147,13 @@ _CFXMLDTDNodePtr _CFXMLParseDTDNode(const unsigned char* xmlString) {
11471147
xmlUnlinkNode(node);
11481148
} else if (dtd->notations) {
11491149
node = (xmlNodePtr)calloc(1, sizeof(_cfxmlNotation));
1150+
// libxml2 v2.9.8 fixed their function signatures, but before that
1151+
// `xmlHashScanner` was defined without the const on `xmlChar *`.
1152+
#if LIBXML_VERSION > 20907
11501153
xmlHashScan((xmlNotationTablePtr)dtd->notations, &_CFXMLNotationScanner, node);
1154+
#else
1155+
xmlHashScan((xmlNotationTablePtr)dtd->notations, (void (*)(void *, void *, xmlChar *))&_CFXMLNotationScanner, node);
1156+
#endif
11511157
}
11521158

11531159
return node;

0 commit comments

Comments
 (0)