diff options
| author | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2011-12-29 11:52:38 +0100 |
|---|---|---|
| committer | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2011-12-29 11:52:38 +0100 |
| commit | 08ec0a6fb7d78277b9194d19b53b21c851afe326 (patch) | |
| tree | 20f51454ecf4c721008751934d5c3ea843085344 /lasso/xml | |
| parent | 8f06751564ed5f767345e17ae0f09ee8199e4a49 (diff) | |
| download | lasso-08ec0a6fb7d78277b9194d19b53b21c851afe326.tar.gz lasso-08ec0a6fb7d78277b9194d19b53b21c851afe326.tar.xz lasso-08ec0a6fb7d78277b9194d19b53b21c851afe326.zip | |
Incompatibility with clang: local functions with closure does not work
Diffstat (limited to 'lasso/xml')
| -rw-r--r-- | lasso/xml/tools.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lasso/xml/tools.c b/lasso/xml/tools.c index 00425043..b31e7187 100644 --- a/lasso/xml/tools.c +++ b/lasso/xml/tools.c @@ -1146,6 +1146,10 @@ lasso_concat_url_query(const char *url, const char *query) } } +static void structuredErrorFunc (void *userData, xmlErrorPtr error) { + *(int*)userData = error->code; +} + /** * lasso_eval_xpath_expression: * @xpath_ctx: the XPath context object @@ -1169,10 +1173,6 @@ lasso_eval_xpath_expression(xmlXPathContextPtr xpath_ctx, const char *expression xmlStructuredErrorFunc oldStructuredErrorFunc; gboolean rc = TRUE; - void structuredErrorFunc (G_GNUC_UNUSED void *userData, xmlErrorPtr error) { - errorCode = error->code; - } - g_return_val_if_fail(xpath_ctx != NULL && expression != NULL, FALSE); if (xpath_error_code) { /* reset */ @@ -1180,8 +1180,10 @@ lasso_eval_xpath_expression(xmlXPathContextPtr xpath_ctx, const char *expression } oldStructuredErrorFunc = xpath_ctx->error; xpath_ctx->error = structuredErrorFunc; + xpath_ctx->userData = &errorCode; xpath_object = xmlXPathEvalExpression((xmlChar*)expression, xpath_ctx); xpath_ctx->error = oldStructuredErrorFunc; + xpath_ctx->userData = NULL; if (xpath_object) { if (xpath_object_ptr) { |
