Skip to content

Commit

Permalink
Fix relax_ng_log_str_err() signature for old libxml2 versions
Browse files Browse the repository at this point in the history
Pull request #137 fixes relax_ng_log_str_err()'s argument list for
libxml2 2.12 and above, but breaks it for libxml2 2.11 and below.
  • Loading branch information
ydahhrk committed Jun 3, 2024
1 parent 2027900 commit cdf9248
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/xml/relax_ng.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,15 @@ relax_ng_log_warn(void *ctx, const char *msg, ...)
VLOG_MSG(warn)
}

/* Signature changed at libxml2 commit 61034116d0a3c8b295c6137956adc3ae55720. */
#if LIBXML_VERSION >= 21200
#define XMLERROR_PARAMTYPE const xmlError *
#else
#define XMLERROR_PARAMTYPE xmlErrorPtr
#endif

static void
relax_ng_log_str_err(void *userData, const xmlError *error)
relax_ng_log_str_err(void *userData, XMLERROR_PARAMTYPE error)
{
pr_val_err("%s (at line %d)", error->message, error->line);
}
Expand Down

0 comments on commit cdf9248

Please sign in to comment.