From 08ee04e6bfa31a1edf823ab27e2519be17c2f633 Mon Sep 17 00:00:00 2001 From: deva Date: Fri, 4 Feb 2011 07:58:02 +0000 Subject: Made export and sunlock compile when no db is to be used. --- server/src/macrotool/export.cc | 10 +++++++++- server/src/macrotool/sunlock.cc | 22 +++++++++++++++------- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/server/src/macrotool/export.cc b/server/src/macrotool/export.cc index 2c3eb05..f42cd34 100644 --- a/server/src/macrotool/export.cc +++ b/server/src/macrotool/export.cc @@ -27,11 +27,15 @@ */ #include "export.h" +#include #include +#include "debug.h" + +#ifndef WITHOUT_DB + #include #include -#include "debug.h" #include "fieldnamescanner.h" #include "configuration.h" @@ -254,6 +258,8 @@ static void export_prefix(std::string prefix) } } +#endif/* WITHOUT_DB */ + static const char usage_str[] = " help Prints this helptext.\n" " prefix p Export all templates matching the prefix p.\n" @@ -274,7 +280,9 @@ void macrotool_export(std::vector params) printf("%s", usage_str); return; } +#ifndef WITHOUT_DB export_prefix(params[1]); +#endif/* WITHOUT_DB */ return; } diff --git a/server/src/macrotool/sunlock.cc b/server/src/macrotool/sunlock.cc index e75e7de..be35101 100644 --- a/server/src/macrotool/sunlock.cc +++ b/server/src/macrotool/sunlock.cc @@ -27,16 +27,14 @@ */ #include "sunlock.h" -#include +#include #include -#include "configuration.h" +#ifndef WITHOUT_DB -static const char usage_str[] = -" help Prints this helptext.\n" -" sid Sets the status of a session id in the database" - " to 'idle'.\n" -; +#include + +#include "configuration.h" static void sunlock_uid(std::string uid) { @@ -65,6 +63,14 @@ static void sunlock_uid(std::string uid) work.commit(); } +#endif/* WITHOUT_DB */ + +static const char usage_str[] = +" help Prints this helptext.\n" +" sid Sets the status of a session id in the database" + " to 'idle'.\n" +; + void macrotool_sunlock(std::vector params) { if(params.size() < 1) { @@ -77,7 +83,9 @@ void macrotool_sunlock(std::vector params) return; } +#ifndef WITHOUT_DB sunlock_uid(params[0]); +#endif/* WITHOUT_DB */ } #ifdef TEST_SUNLOCK -- cgit v1.2.3