diff options
author | Nick Wellnhofer <wellnhofer@aevum.de> | 2019-05-11 14:03:13 +0200 |
---|---|---|
committer | Nick Wellnhofer <wellnhofer@aevum.de> | 2019-05-12 15:33:51 +0200 |
commit | 7503b1963887c93318d8f994e065045c81825193 (patch) | |
tree | cbd215b5a90af565b665af6d1abb89c50a9c3016 | |
parent | 8a5dcc6e9da769bb49ce6a750cc0ef094d621b43 (diff) | |
download | libxslt-7503b1963887c93318d8f994e065045c81825193.tar.gz |
Hide unused code when compiling without debugger
-rw-r--r-- | libxslt/transform.c | 2 | ||||
-rw-r--r-- | libxslt/xsltutils.c | 67 |
2 files changed, 54 insertions, 15 deletions
diff --git a/libxslt/transform.c b/libxslt/transform.c index b4c8a7cc..a9952c8d 100644 --- a/libxslt/transform.c +++ b/libxslt/transform.c @@ -2205,6 +2205,7 @@ xsltProcessOneNode(xsltTransformContextPtr ctxt, xmlNodePtr contextNode, } } +#ifdef WITH_DEBUGGER static xmlNodePtr xsltDebuggerStartSequenceConstructor(xsltTransformContextPtr ctxt, xmlNodePtr contextNode, @@ -2240,6 +2241,7 @@ xsltDebuggerStartSequenceConstructor(xsltTransformContextPtr ctxt, } return(debugedNode); } +#endif /* WITH_DEBUGGER */ /** * xsltLocalVariablePush: diff --git a/libxslt/xsltutils.c b/libxslt/xsltutils.c index 5e957876..74bd6f0f 100644 --- a/libxslt/xsltutils.c +++ b/libxslt/xsltutils.c @@ -2346,6 +2346,23 @@ xsltXPathCompile(xsltStylesheetPtr style, const xmlChar *str) { * * ************************************************************************/ +int xslDebugStatus; + +/** + * xsltGetDebuggerStatus: + * + * Get xslDebugStatus. + * + * Returns the value of xslDebugStatus. + */ +int +xsltGetDebuggerStatus(void) +{ + return(xslDebugStatus); +} + +#ifdef WITH_DEBUGGER + /* * There is currently only 3 debugging callback defined * Debugger callbacks are disabled by default @@ -2366,8 +2383,6 @@ static xsltDebuggerCallbacks xsltDebuggerCurrentCallbacks = { NULL /* drop */ }; -int xslDebugStatus; - /** * xsltSetDebuggerStatus: * @value : the value to be set @@ -2381,19 +2396,6 @@ xsltSetDebuggerStatus(int value) } /** - * xsltGetDebuggerStatus: - * - * Get xslDebugStatus. - * - * Returns the value of xslDebugStatus. - */ -int -xsltGetDebuggerStatus(void) -{ - return(xslDebugStatus); -} - -/** * xsltSetDebuggerCallbacks: * @no : number of callbacks * @block : the block of callbacks @@ -2467,3 +2469,38 @@ xslDropCall(void) xsltDebuggerCurrentCallbacks.drop(); } +#else /* WITH_DEBUGGER */ + +void +xsltSetDebuggerStatus(int value) { + if (value != XSLT_DEBUG_NONE) { + xsltGenericError(xsltGenericErrorContext, + "xsltSetDebuggerStatus: libxslt compiled without debugger\n"); + } +} + +int +xsltSetDebuggerCallbacks(int no ATTRIBUTE_UNUSED, + void *block ATTRIBUTE_UNUSED) { + return(-1); +} + +void +xslHandleDebugger(xmlNodePtr cur ATTRIBUTE_UNUSED, + xmlNodePtr node ATTRIBUTE_UNUSED, + xsltTemplatePtr templ ATTRIBUTE_UNUSED, + xsltTransformContextPtr ctxt ATTRIBUTE_UNUSED) { +} + +int +xslAddCall(xsltTemplatePtr templ ATTRIBUTE_UNUSED, + xmlNodePtr source ATTRIBUTE_UNUSED) { + return(-1); +} + +void +xslDropCall(void) { +} + +#endif /* WITH_DEBUGGER */ + |