Skip to content
This repository was archived by the owner on Jan 26, 2026. It is now read-only.

Commit 7c31519

Browse files
committed
include: Readd circular dependency between tree.h and parser.h
There are dozens of downstream projects that only include tree.h but use declarations from parser.h. This broke after the recent cleanup of circular dependencies. Make tree.h include parser.h again. This is a hack but doesn't change the include directory struture. This commit only made it into the 2.12 branch but wasn't applied to master, so the issue turned up in 2.13.0 again. Should fix #734.
1 parent 95939d6 commit 7c31519

5 files changed

Lines changed: 19 additions & 0 deletions

File tree

include/libxml/entities.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
#define __XML_ENTITIES_H__
1313

1414
#include <libxml/xmlversion.h>
15+
#define XML_TREE_INTERNALS
1516
#include <libxml/tree.h>
17+
#undef XML_TREE_INTERNALS
1618

1719
#ifdef __cplusplus
1820
extern "C" {

include/libxml/parser.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
#define __XML_PARSER_H__
1212

1313
#include <libxml/xmlversion.h>
14+
#define XML_TREE_INTERNALS
1415
#include <libxml/tree.h>
16+
#undef XML_TREE_INTERNALS
1517
#include <libxml/dict.h>
1618
#include <libxml/hash.h>
1719
#include <libxml/valid.h>

include/libxml/tree.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@
99
* Author: Daniel Veillard
1010
*/
1111

12+
#ifndef XML_TREE_INTERNALS
13+
14+
/*
15+
* Emulate circular dependency for backward compatibility
16+
*/
17+
#include <libxml/parser.h>
18+
19+
#else /* XML_TREE_INTERNALS */
20+
1221
#ifndef __XML_TREE_H__
1322
#define __XML_TREE_H__
1423

@@ -1369,3 +1378,5 @@ XML_DEPRECATED XMLPUBFUN int
13691378

13701379
#endif /* __XML_TREE_H__ */
13711380

1381+
#endif /* XML_TREE_INTERNALS */
1382+

include/libxml/valid.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313

1414
#include <libxml/xmlversion.h>
1515
#include <libxml/xmlerror.h>
16+
#define XML_TREE_INTERNALS
1617
#include <libxml/tree.h>
18+
#undef XML_TREE_INTERNALS
1719
#include <libxml/list.h>
1820
#include <libxml/xmlautomata.h>
1921
#include <libxml/xmlregexp.h>

include/libxml/xmlIO.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
#include <stdio.h>
1414
#include <libxml/xmlversion.h>
1515
#include <libxml/encoding.h>
16+
#define XML_TREE_INTERNALS
1617
#include <libxml/tree.h>
18+
#undef XML_TREE_INTERNALS
1719

1820
#ifdef __cplusplus
1921
extern "C" {

0 commit comments

Comments
 (0)