diff --git a/lib/clixon/clixon_xpath.h b/lib/clixon/clixon_xpath.h index 3ccf4b9a4..53a655b6f 100644 --- a/lib/clixon/clixon_xpath.h +++ b/lib/clixon/clixon_xpath.h @@ -118,10 +118,10 @@ struct xpath_tree{ struct xpath_tree *xs_c0; /* child 0 */ struct xpath_tree *xs_c1; /* child 1 */ int xs_match; /* meta: match this node */ -#ifdef XPATH_CURRENT_OPTIMIZE + /* Unconditional (not only XPATH_CURRENT_OPTIMIZE): struct layout must not depend on + * compile options, see https://github.com/clicon/clixon/issues/698 */ void *xs_cached_result; /* xp_ctx *: cached evaluation result */ void *xs_cached_initial; /* cxobj *: xc_initial for which cache is valid */ -#endif }; typedef struct xpath_tree xpath_tree; diff --git a/lib/clixon/clixon_xpath_ctx.h b/lib/clixon/clixon_xpath_ctx.h index 4f4ba58fb..002734d9f 100644 --- a/lib/clixon/clixon_xpath_ctx.h +++ b/lib/clixon/clixon_xpath_ctx.h @@ -88,9 +88,9 @@ struct xp_ctx{ cxobj *xc_initial; /* RFC 7960 10.1.1 extension: for current() */ int xc_descendant; /* // */ /* NYI: a set of variable bindings, set of namespace declarations */ -#ifdef XPATH_CURRENT_OPTIMIZE + /* Unconditional (not only XPATH_CURRENT_OPTIMIZE): struct layout must not depend on + * compile options, see https://github.com/clicon/clixon/issues/698 */ int xc_invariant; /* result depends only on xc_initial (current()) */ -#endif }; typedef struct xp_ctx xp_ctx; diff --git a/lib/src/clixon_xpath_ctx.c b/lib/src/clixon_xpath_ctx.c index f1022e67b..d8e7f256c 100644 --- a/lib/src/clixon_xpath_ctx.c +++ b/lib/src/clixon_xpath_ctx.c @@ -36,6 +36,10 @@ * Clixon XML XPath 1.0 according to https://www.w3.org/TR/xpath-10 * This file defines XPath contexts used in traversing the XPath parse tree. */ +#ifdef HAVE_CONFIG_H +#include "clixon_config.h" /* generated by config & autoconf */ +#endif + #include #include #include