Skip to content

Commit

Permalink
Unbreak compilation against latest libxml2 blead #111
Browse files Browse the repository at this point in the history
  • Loading branch information
dwarring committed May 13, 2024
1 parent 36dd4ec commit cb98bf0
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
8 changes: 8 additions & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ debug :
coverage :
%MAKE% "DBG=-fprofile-arcs -ftest-coverage" "LD_DBG=-coverage -lgcov" all

# compile against checked out libxml2 source (pre-built)
all-via-libxml2-src : ../libxml2/include
raku Build.pm6 -I ../libxml2/include
%MAKE% clean
%MAKE% all
raku Build.pm6;
@echo "** Please set LD_LIBRARY_PATH to ../libxml2/.libs ***"

resources/libraries/%LIB-NAME% : $(SRC)/dom%O% $(SRC)/domXPath%O% $(SRC)/xml6_parser_ctx%O% $(SRC)/xml6_config%O% $(SRC)/xml6_doc%O% $(SRC)/xml6_entity%O% $(SRC)/xml6_gbl%O% $(SRC)/xml6_hash%O% $(SRC)/xml6_input%O% $(SRC)/xml6_node%O% $(SRC)/xml6_notation%O% $(SRC)/xml6_ns%O% $(SRC)/xml6_sax%O% $(SRC)/xml6_ref%O% $(SRC)/xml6_reader%O% $(SRC)/xml6_xpath%O% $(SRC)/xml6_error%O%
%LD% %LDSHARED% %LDFLAGS% %LDOUT%resources/libraries/%LIB-NAME% \
$(SRC)/dom%O% $(SRC)/domXPath%O% $(SRC)/xml6_parser_ctx%O% $(SRC)/xml6_config%O% $(SRC)/xml6_doc%O% $(SRC)/xml6_entity%O% $(SRC)/xml6_gbl%O% $(SRC)/xml6_hash%O% $(SRC)/xml6_input%O% $(SRC)/xml6_node%O% $(SRC)/xml6_notation%O% $(SRC)/xml6_ns%O% $(SRC)/xml6_sax%O% $(SRC)/xml6_ref%O% $(SRC)/xml6_reader%O% $(SRC)/xml6_xpath%O% $(SRC)/xml6_error%O% \
Expand Down
3 changes: 2 additions & 1 deletion lib/LibXML/Raw.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,6 @@ class xmlSAXLocator is export {
has Pointer $.getColumnNumberFunc is rw-ptr(
method xml6_sax_locator_set_getColumnNumber( &cb (xmlParserCtxt $ctx --> int32) ) is native($BIND-XML2) {*}
);
method init is native($XML2) is symbol('xml6_sax_locator_init') {*}

submethod BUILD(*%atts) {
for %atts.pairs.sort {
Expand Down Expand Up @@ -1127,6 +1126,8 @@ class xmlAttr is anyNode does LibXML::Raw::DOM::Attr is export {
has xmlNs $.ns; # the associated namespace
has int32 $.atype; # the attribute type if validating
has Pointer $.psvi; # for type/PSVI information
## todo Only available in newer libxml2 versions!
has Pointer $!id; # the ID struct

method Free is native($XML2) is symbol('xmlFreeProp') {*}
method xmlCopyProp(--> xmlAttr) is native($XML2) {*}
Expand Down
1 change: 1 addition & 0 deletions src/xml6_error.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef __XML6_ERROR_H
#define __XML6_ERROR_H

#include <libxml/xmlstring.h>
#include <libxml/xmlerror.h>

DLLEXPORT xmlChar*
Expand Down
7 changes: 0 additions & 7 deletions src/xml6_sax.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,6 @@ DLLEXPORT void xml6_sax_set_serror(xmlSAXHandlerPtr self, xmlStructuredErrorFunc

// SaxLocator Methods

DLLEXPORT void xml6_sax_locator_init(xmlSAXLocatorPtr self) {
self->getPublicId = xmlDefaultSAXLocator.getPublicId;
self->getSystemId = xmlDefaultSAXLocator.getSystemId;
self->getLineNumber = xmlDefaultSAXLocator.getLineNumber;
self->getColumnNumber = xmlDefaultSAXLocator.getColumnNumber;
}

DLLEXPORT void xml6_sax_locator_set_getPublicId(xmlSAXLocatorPtr self, void *func) {
self->getPublicId = func;
}
Expand Down
2 changes: 1 addition & 1 deletion t/00native.t
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ for 1 ..^ @ClassMap -> $type {
my $class := @ClassMap[$type];
if $class ~~ anyNode|xmlNs {
todo "has known size changes between libxml2 versions"
if $type == XML_ENTITY_DECL;
if $type == XML_ENTITY_DECL|XML_ATTRIBUTE_NODE;
is node-size($type), nativesizeof($class), 'size of ' ~ $class.raku;
}
else {
Expand Down

0 comments on commit cb98bf0

Please sign in to comment.