summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
6f7b39f)
The change ensures that the function is not seen by the compiler when
the debug mode is not enabled. The flag is not set by default, because
it might have a significant performance impact for large indices.
The reason for the flag is that the default configuration under Linux
forbids the definition of unused functions.
using namespace std;
using namespace lyx::support;
using namespace std;
using namespace lyx::support;
+// Uncomment to enable InsetIndex-specific debugging mode: the tree for the index will be printed to std::cout.
+// #define LYX_INSET_INDEX_DEBUG
+
namespace lyx {
namespace {
namespace lyx {
namespace {
-// Only useful for debugging.
+#ifdef LYX_INSET_INDEX_DEBUG
void printTree(const IndexNode* root_node, unsigned depth = 0)
{
static const std::string pattern = " ";
void printTree(const IndexNode* root_node, unsigned depth = 0)
{
static const std::string pattern = " ";
printTree(node, depth + 1);
}
}
printTree(node, depth + 1);
}
}
+#endif // LYX_INSET_INDEX_DEBUG
return docstring();
const IndexNode* index_root = buildIndexTree(entries);
return docstring();
const IndexNode* index_root = buildIndexTree(entries);
+#ifdef LYX_INSET_INDEX_DEBUG
printTree(index_root);
#endif
printTree(index_root);
#endif