summaryrefslogtreecommitdiff
path: root/bin/bbackupquery
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2011-01-21 23:24:13 +0000
committerChris Wilson <chris+github@qwirx.com>2011-01-21 23:24:13 +0000
commit385d5fa23a1a510bb5def0311ae903883b1154e8 (patch)
treea58a5a33376294ffaef985420dbe4cb678c97a00 /bin/bbackupquery
parent6d196ba80a71a747e73a1a61fa2aae7e1efec50a (diff)
Fix compile errors using readline on win32.
Diffstat (limited to 'bin/bbackupquery')
-rw-r--r--bin/bbackupquery/bbackupquery.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/bin/bbackupquery/bbackupquery.cpp b/bin/bbackupquery/bbackupquery.cpp
index bc4cff13..b07a3ba7 100644
--- a/bin/bbackupquery/bbackupquery.cpp
+++ b/bin/bbackupquery/bbackupquery.cpp
@@ -163,6 +163,14 @@ char * completion_generator(const char *text, int state)
#define RL_COMPLETION_MATCHES rl_completion_matches
#elif defined HAVE_COMPLETION_MATCHES
#define RL_COMPLETION_MATCHES completion_matches
+#else
+ char* no_matches[] = {NULL};
+ char** bbackupquery_completion_dummy(const char *text,
+ char * (completion_generator)(const char *text, int state))
+ {
+ return no_matches;
+ }
+ #define RL_COMPLETION_MATCHES bbackupquery_completion_dummy
#endif
char ** bbackupquery_completion(const char *text, int start, int end)
@@ -215,15 +223,17 @@ int main(int argc, const char *argv[])
#endif
#ifdef WIN32
- const char* validOpts = "qvVwuc:l:o:O:W:";
+ #define WIN32_OPTIONS "u"
bool unicodeConsole = false;
-#elif defined HAVE_LIBREADLINE // && !WIN32
- const char* validOpts = "qvVwEc:l:o:O:W:";
+#endif
+
+#ifdef HAVE_LIBREADLINE
+ #define READLINE_OPTIONS "E"
bool useReadline = true;
-#else
- const char* validOpts = "qvVwc:l:o:O:W:";
#endif
+ const char* validOpts = "qvVwc:l:o:O:W:" WIN32_OPTIONS READLINE_OPTIONS;
+
std::string fileLogFile;
Log::Level fileLogLevel = Log::INVALID;
@@ -316,7 +326,9 @@ int main(int argc, const char *argv[])
case 'u':
unicodeConsole = true;
break;
-#elif defined HAVE_LIBREADLINE // && !WIN32
+#endif
+
+#ifdef HAVE_LIBREADLINE
case 'E':
useReadline = false;
break;