aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorEugene Sandulenko2016-10-17 18:45:12 +0200
committerEugene Sandulenko2016-10-17 18:55:22 +0200
commite8b70a4686916774a1bf499c9c3136e3052b6b43 (patch)
tree93ca440db8e01bf53376909ebb5670f961613c8b /backends
parentd3c173da7aa3ffcb62243816bd74ccb4ca3ec5b2 (diff)
downloadscummvm-rg350-e8b70a4686916774a1bf499c9c3136e3052b6b43.tar.gz
scummvm-rg350-e8b70a4686916774a1bf499c9c3136e3052b6b43.tar.bz2
scummvm-rg350-e8b70a4686916774a1bf499c9c3136e3052b6b43.zip
ALL: Fix compilation with disabled cloud but enabled libcurl
Diffstat (limited to 'backends')
-rw-r--r--backends/module.mk9
-rw-r--r--backends/saves/default/default-saves.cpp12
-rw-r--r--backends/saves/savefile.cpp4
3 files changed, 16 insertions, 9 deletions
diff --git a/backends/module.mk b/backends/module.mk
index 10dde0be8f..158f9a3b7c 100644
--- a/backends/module.mk
+++ b/backends/module.mk
@@ -19,6 +19,8 @@ MODULE_OBJS := \
saves/default/default-saves.o \
timer/default/default-timer.o
+ifdef USE_CLOUD
+
ifdef USE_LIBCURL
MODULE_OBJS += \
cloud/cloudicon.o \
@@ -52,7 +54,12 @@ MODULE_OBJS += \
cloud/onedrive/onedrivecreatedirectoryrequest.o \
cloud/onedrive/onedrivetokenrefresher.o \
cloud/onedrive/onedrivelistdirectoryrequest.o \
- cloud/onedrive/onedriveuploadrequest.o \
+ cloud/onedrive/onedriveuploadrequest.o
+endif
+endif
+
+ifdef USE_LIBCURL
+MODULE_OBJS += \
networking/curl/connectionmanager.o \
networking/curl/networkreadstream.o \
networking/curl/curlrequest.o \
diff --git a/backends/saves/default/default-saves.cpp b/backends/saves/default/default-saves.cpp
index d1fdabeec9..a0c5470c9f 100644
--- a/backends/saves/default/default-saves.cpp
+++ b/backends/saves/default/default-saves.cpp
@@ -27,7 +27,7 @@
#include "common/scummsys.h"
-#ifdef USE_LIBCURL
+#if defined(USE_CLOUD) && defined(USE_LIBCURL)
#include "backends/cloud/cloudmanager.h"
#include "common/file.h"
#endif
@@ -47,7 +47,7 @@
#include <errno.h> // for removeSavefile()
#endif
-#ifdef USE_LIBCURL
+#if defined(USE_CLOUD) && defined(USE_LIBCURL)
const char *DefaultSaveFileManager::TIMESTAMPS_FILENAME = "timestamps";
#endif
@@ -147,7 +147,7 @@ Common::OutSaveFile *DefaultSaveFileManager::openForSaving(const Common::String
}
}
-#ifdef USE_LIBCURL
+#if defined(USE_CLOUD) && defined(USE_LIBCURL)
// Update file's timestamp
Common::HashMap<Common::String, uint32> timestamps = loadTimestamps();
timestamps[filename] = INVALID_TIMESTAMP;
@@ -182,7 +182,7 @@ bool DefaultSaveFileManager::removeSavefile(const Common::String &filename) {
if (getError().getCode() != Common::kNoError)
return false;
-#ifdef USE_LIBCURL
+#if defined(USE_CLOUD) && defined(USE_LIBCURL)
// Update file's timestamp
Common::HashMap<Common::String, uint32> timestamps = loadTimestamps();
Common::HashMap<Common::String, uint32>::iterator it = timestamps.find(filename);
@@ -247,7 +247,7 @@ void DefaultSaveFileManager::assureCached(const Common::String &savePathName) {
// Check that path exists and is usable.
checkPath(Common::FSNode(savePathName));
-#ifdef USE_LIBCURL
+#if defined(USE_CLOUD) && defined(USE_LIBCURL)
Common::Array<Common::String> files = CloudMan.getSyncingFiles(); //returns empty array if not syncing
if (!files.empty()) updateSavefilesList(files); //makes this cache invalid
else _lockedFiles = files;
@@ -288,7 +288,7 @@ void DefaultSaveFileManager::assureCached(const Common::String &savePathName) {
_cachedDirectory = savePathName;
}
-#ifdef USE_LIBCURL
+#if defined(USE_CLOUD) && defined(USE_LIBCURL)
Common::HashMap<Common::String, uint32> DefaultSaveFileManager::loadTimestamps() {
Common::HashMap<Common::String, uint32> timestamps;
diff --git a/backends/saves/savefile.cpp b/backends/saves/savefile.cpp
index e21ea16ad8..21f53b8de2 100644
--- a/backends/saves/savefile.cpp
+++ b/backends/saves/savefile.cpp
@@ -23,7 +23,7 @@
#include "common/util.h"
#include "common/savefile.h"
#include "common/str.h"
-#ifdef USE_LIBCURL
+#if defined(USE_CLOUD) && defined(USE_LIBCURL)
#include "backends/cloud/cloudmanager.h"
#endif
@@ -39,7 +39,7 @@ void OutSaveFile::clearErr() { _wrapped->clearErr(); }
void OutSaveFile::finalize() {
_wrapped->finalize();
-#ifdef USE_LIBCURL
+#if defined(USE_CLOUD) && defined(USE_LIBCURL)
CloudMan.syncSaves();
#endif
}