diff --git a/configure b/configure index 7a3e52fa389..7c5035ac3c3 100755 --- a/configure +++ b/configure @@ -9242,6 +9242,48 @@ if test "x$ac_cv_lib_xml2_xmlSchemaSetValidStructuredErrors" = x""yes; then : $as_echo "#define HAVE_XMLSCHEMASSETVALIDSTRUCTUREDERRORS 1" >>confdefs.h +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlFirstElementChild in -lxml2" >&5 +$as_echo_n "checking for xmlFirstElementChild in -lxml2... " >&6; } +if test "${ac_cv_lib_xml2_xmlFirstElementChild+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lxml2 $ac_xml_libs $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char xmlFirstElementChild (); +int +main () +{ +return xmlFirstElementChild (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_xml2_xmlFirstElementChild=yes +else + ac_cv_lib_xml2_xmlFirstElementChild=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xml2_xmlFirstElementChild" >&5 +$as_echo "$ac_cv_lib_xml2_xmlFirstElementChild" >&6; } +if test "x$ac_cv_lib_xml2_xmlFirstElementChild" = x""yes; then : + +$as_echo "#define HAVE_XMLFIRSTELEMENTCHILD 1" >>confdefs.h + fi ac_fn_c_check_type "$LINENO" "xmlDocProperties" "ac_cv_type_xmlDocProperties" "#include diff --git a/configure.ac b/configure.ac index d4430bec1a9..598673d61ce 100644 --- a/configure.ac +++ b/configure.ac @@ -1121,6 +1121,8 @@ then [AC_DEFINE(HAVE_XMLNEWDOCPI,1,[Define if libxml2 has the xmlNewDocPI function])],,$ac_xml_libs) AC_CHECK_LIB(xml2, xmlSchemaSetValidStructuredErrors, [AC_DEFINE(HAVE_XMLSCHEMASSETVALIDSTRUCTUREDERRORS,1,[Define if libxml2 has the xmlSchemaSetValidStructuredErrors function])],,$ac_xml_libs) + AC_CHECK_LIB(xml2, xmlFirstElementChild, + [AC_DEFINE(HAVE_XMLFIRSTELEMENTCHILD,1,[Define if libxml2 has the xmlFirstElementChild function])],,$ac_xml_libs) AC_CHECK_TYPE([xmlDocProperties], [AC_DEFINE(HAVE_XMLDOC_PROPERTIES,1,[Define if libxml2 has the xmlDocProperties enum])],,[[#include ]]) ]) diff --git a/dlls/msxml3/msxml_private.h b/dlls/msxml3/msxml_private.h index 183f97cacc9..e7a143ec55f 100644 --- a/dlls/msxml3/msxml_private.h +++ b/dlls/msxml3/msxml_private.h @@ -112,6 +112,18 @@ BOOL dispex_query_interface(DispatchEx*,REFIID,void**); #include +#ifndef HAVE_XMLFIRSTELEMENTCHILD +static inline xmlNodePtr xmlFirstElementChild(xmlNodePtr parent) +{ + xmlNodePtr child; + for (child = parent->children; child != NULL; child = child->next) + if (child->type == XML_ELEMENT_NODE) + break; + + return child; +} +#endif + /* constructors */ extern IUnknown *create_domdoc( xmlNodePtr document ); extern IUnknown *create_xmldoc( void ); diff --git a/include/config.h.in b/include/config.h.in index 46adad8743e..3117f695d15 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -1108,6 +1108,9 @@ /* Define if libxml2 has the xmlDocProperties enum */ #undef HAVE_XMLDOC_PROPERTIES +/* Define if libxml2 has the xmlFirstElementChild function */ +#undef HAVE_XMLFIRSTELEMENTCHILD + /* Define if libxml2 has the xmlNewDocPI function */ #undef HAVE_XMLNEWDOCPI