[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4' - common/FileUtil.cpp common/Log.cpp common/Png.hpp common/SigUtil.cpp common/SigUtil.hpp common/Unit.cpp common/Util.cpp common/Util.hpp configure.ac gtk/Makefile.am kit/ChildSession.cpp kit/Kit.cpp kit/Kit.hpp net/FakeSocket.hpp net/ServerSocket.hpp net/Socket.cpp net/Socket.hpp net/WebSocketHandler.hpp test/fakesockettest.cpp wsd/Auth.hpp wsd/ClientSession.cpp wsd/DocumentBroker.cpp wsd/DocumentBroker.hpp wsd/LOOLWSD.cpp wsd/LOOLWSD.hpp wsd/Storage.cpp

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri May 3 14:00:46 UTC 2019


 common/FileUtil.cpp      |    4 +-
 common/Log.cpp           |    2 -
 common/Png.hpp           |    2 -
 common/SigUtil.cpp       |    2 -
 common/SigUtil.hpp       |    4 +-
 common/Unit.cpp          |    2 -
 common/Util.cpp          |    4 +-
 common/Util.hpp          |    6 +--
 configure.ac             |    2 -
 gtk/Makefile.am          |    2 -
 kit/ChildSession.cpp     |   12 +++---
 kit/Kit.cpp              |   40 ++++++++++-----------
 kit/Kit.hpp              |    4 +-
 net/FakeSocket.hpp       |    2 -
 net/ServerSocket.hpp     |    4 +-
 net/Socket.cpp           |   18 ++++-----
 net/Socket.hpp           |   30 ++++++++--------
 net/WebSocketHandler.hpp |   22 ++++++------
 test/fakesockettest.cpp  |    5 +-
 wsd/Auth.hpp             |    4 +-
 wsd/ClientSession.cpp    |    4 +-
 wsd/DocumentBroker.cpp   |   30 ++++++++--------
 wsd/DocumentBroker.hpp   |    4 +-
 wsd/LOOLWSD.cpp          |   86 +++++++++++++++++++++++------------------------
 wsd/LOOLWSD.hpp          |    4 +-
 wsd/Storage.cpp          |   14 +++----
 26 files changed, 157 insertions(+), 156 deletions(-)

New commits:
commit c7304eaa790ffeeeb07004b19f02c1a3f5108130
Author:     Jan Holesovsky <kendy at collabora.com>
AuthorDate: Tue Feb 12 12:16:40 2019 +0100
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Fri May 3 15:00:14 2019 +0100

    android: #if(n)def MOBILEAPP -> #if (!)MOBILEAPP for better reliability.
    
    Change-Id: I5f9c9420b6c83601db1c8fdba4ae5a10b17b2107
    Signed-off-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/common/FileUtil.cpp b/common/FileUtil.cpp
index 0ba6256d0..d1971b69f 100644
--- a/common/FileUtil.cpp
+++ b/common/FileUtil.cpp
@@ -190,7 +190,7 @@ namespace
 
 namespace FileUtil
 {
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     void registerFileSystemForDiskSpaceChecks(const std::string& path)
     {
         const std::string::size_type lastSlash = path.rfind('/');
@@ -240,7 +240,7 @@ namespace FileUtil
     {
         assert(!path.empty());
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         bool hookResult;
         if (UnitBase::get().filterCheckDiskSpace(path, hookResult))
             return hookResult;
diff --git a/common/Log.cpp b/common/Log.cpp
index a5f101e93..eb3892643 100644
--- a/common/Log.cpp
+++ b/common/Log.cpp
@@ -147,7 +147,7 @@ namespace Log
         Source.setName(name);
         std::ostringstream oss;
         oss << Source.getName();
-#ifndef MOBILEAPP // Just one process in a mobile app, the pid is uninteresting.
+#if !MOBILEAPP // Just one process in a mobile app, the pid is uninteresting.
         oss << '-'
             << std::setw(5) << std::setfill('0') << Poco::Process::id();
 #endif
diff --git a/common/Png.hpp b/common/Png.hpp
index 62e24357d..d4e1c2cf5 100644
--- a/common/Png.hpp
+++ b/common/Png.hpp
@@ -134,7 +134,7 @@ bool encodeSubBufferToPNG(unsigned char* pixmap, size_t startX, size_t startY,
         return false;
     }
 
-#ifdef MOBILEAPP
+#if MOBILEAPP
     png_set_compression_level(png_ptr, Z_BEST_SPEED);
 #else
     // Level 4 gives virtually identical compression
diff --git a/common/SigUtil.cpp b/common/SigUtil.cpp
index 77ed8e296..236fef176 100644
--- a/common/SigUtil.cpp
+++ b/common/SigUtil.cpp
@@ -39,7 +39,7 @@
 std::atomic<bool> TerminationFlag(false);
 std::atomic<bool> DumpGlobalState(false);
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 std::atomic<bool> ShutdownRequestFlag(false);
 
 std::mutex SigHandlerTrap;
diff --git a/common/SigUtil.hpp b/common/SigUtil.hpp
index 1bffbde47..7c247ad0d 100644
--- a/common/SigUtil.hpp
+++ b/common/SigUtil.hpp
@@ -13,7 +13,7 @@
 #include <atomic>
 #include <mutex>
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 /// Flag to commence clean shutdown
 extern std::atomic<bool> ShutdownRequestFlag;
 #else
@@ -26,7 +26,7 @@ extern std::atomic<bool> TerminationFlag;
 /// Flag to dump internal state
 extern std::atomic<bool> DumpGlobalState;
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 
 /// Mutex to trap signal handler, if any,
 /// and prevent _Exit while collecting backtrace.
diff --git a/common/Unit.cpp b/common/Unit.cpp
index 7eba4fc2a..820f465ff 100644
--- a/common/Unit.cpp
+++ b/common/Unit.cpp
@@ -30,7 +30,7 @@ static Poco::Thread TimeoutThread("unit timeout");
 
 UnitBase *UnitBase::linkAndCreateUnit(UnitType type, const std::string &unitLibPath)
 {
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     void *dlHandle = dlopen(unitLibPath.c_str(), RTLD_GLOBAL|RTLD_NOW);
     if (!dlHandle)
     {
diff --git a/common/Util.cpp b/common/Util.cpp
index ccde3c0d7..b0af5c6c6 100644
--- a/common/Util.cpp
+++ b/common/Util.cpp
@@ -148,7 +148,7 @@ namespace Util
         return newTmp;
     }
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     int getProcessThreadCount()
     {
         DIR *fdDir = opendir("/proc/self/task");
@@ -296,7 +296,7 @@ namespace Util
         return std::getenv("DISPLAY") != nullptr;
     }
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 
     static const char *startsWith(const char *line, const char *tag)
     {
diff --git a/common/Util.hpp b/common/Util.hpp
index 5bf6d9d03..a92f0c0cc 100644
--- a/common/Util.hpp
+++ b/common/Util.hpp
@@ -54,7 +54,7 @@ namespace Util
     /// Create randomized temporary directory
     std::string createRandomTmpDir();
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     /// Get number of threads in this process or -1 on error
     int getProcessThreadCount();
 
@@ -73,7 +73,7 @@ namespace Util
 
     bool windowingAvailable();
 
-#if !defined(BUILDING_TESTS) && !defined(KIT_IN_PROCESS) && !defined(MOBILEAPP)
+#if !defined(BUILDING_TESTS) && !defined(KIT_IN_PROCESS) && !MOBILEAPP
 
     /// Send a message to all clients.
     void alertAllUsers(const std::string& msg);
@@ -117,7 +117,7 @@ namespace Util
 #endif
     }
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     /// Print given number of bytes in human-understandable form (KB,MB, etc.)
     std::string getHumanizedBytes(unsigned long nBytes);
 
diff --git a/configure.ac b/configure.ac
index 9dcc67620..f8ad130c7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -452,7 +452,7 @@ AS_IF([test "$ENABLE_GTKAPP" = true],
 AM_CONDITIONAL([ENABLE_DEBUG], [test "$ENABLE_DEBUG" = "true"])
 
 mobile_app=
-MOBILEAPP=
+MOBILEAPP=0
 AC_MSG_CHECKING([Is this a mobile app])
 if test "$enable_gtkapp" = "yes" -o "$enable_iosapp" = "yes"; then
      AC_MSG_RESULT([Yes])
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 6d767bbc0..1a6241ca6 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -3,7 +3,7 @@ bin_PROGRAMS = mobile
 include_paths = -I${top_srcdir}/common -I${top_srcdir}/net -I${top_srcdir}/kit -I${top_srcdir}/wsd -I${top_srcdir}
 
 warning_flags = -Wall -Werror -Wno-parentheses -Wno-sign-compare -Wno-unused-variable -Wno-stringop-overflow
-define_flags = -DMOBILEAPP
+define_flags = -DMOBILEAPP=1
 
 AM_CPPFLAGS = -pthread \
               -DLOOLWSD_DATADIR='"@LOOLWSD_DATADIR@"' \
diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp
index 26b4ca84f..07fd7c0c9 100644
--- a/kit/ChildSession.cpp
+++ b/kit/ChildSession.cpp
@@ -25,7 +25,7 @@
 #include <Poco/URI.h>
 #include <Poco/BinaryReader.h>
 #include <Poco/Base64Decoder.h>
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 #include <Poco/Net/HTTPResponse.h>
 #include <Poco/Net/HTTPSClientSession.h>
 #include <Poco/Net/SSLManager.h>
@@ -386,7 +386,7 @@ bool ChildSession::_handleInput(const char *buffer, int length)
         {
             askSignatureStatus(buffer, length, tokens);
         }
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         else if (tokens[0] == "uploadsigneddocument")
         {
             return uploadSignedDocument(buffer, length, tokens);
@@ -409,7 +409,7 @@ bool ChildSession::_handleInput(const char *buffer, int length)
     return true;
 }
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 
 // add to common / tools
 size_t getFileSize(const std::string& filename)
@@ -967,7 +967,7 @@ bool ChildSession::insertFile(const char* /*buffer*/, int /*length*/, const std:
 {
     std::string name, type;
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     if (tokens.size() != 3 ||
         !getTokenString(tokens[1], "name", name) ||
         !getTokenString(tokens[2], "type", type))
@@ -991,7 +991,7 @@ bool ChildSession::insertFile(const char* /*buffer*/, int /*length*/, const std:
     {
         std::string url;
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         if (type == "graphic")
             url = "file://" + std::string(JAILED_DOCUMENT_ROOT) + "insertfile/" + name;
         else if (type == "graphicurl")
@@ -1481,7 +1481,7 @@ bool ChildSession::signDocumentContent(const char* buffer, int length, const std
     return bResult;
 }
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 
 bool ChildSession::exportSignAndUploadDocument(const char* buffer, int length, const std::vector<std::string>& /*tokens*/)
 {
diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index c61c99251..42b370151 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -70,7 +70,7 @@
 #include <Util.hpp>
 #include "Delta.hpp"
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 #include <common/SigUtil.hpp>
 #include <common/Seccomp.hpp>
 #endif
@@ -80,7 +80,7 @@
 #include <wsd/LOOLWSD.hpp>
 #endif
 
-#ifdef MOBILEAPP
+#if MOBILEAPP
 #include "LOOLWSD.hpp"
 #endif
 
@@ -126,7 +126,7 @@ static std::string ObfuscatedFileId;
 #  define ADD_DEBUG_RENDERID ("\n")
 #endif
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 
 static LokHookFunction2* initFunction = nullptr;
 
@@ -750,7 +750,7 @@ private:
     std::vector<unsigned char> _pixmap;
 };
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 static FILE* ProcSMapsFile = nullptr;
 #endif
 
@@ -998,7 +998,7 @@ public:
             }
 
             num_sessions = _sessions.size();
-#ifndef MOBILEAPP
+#if !MOBILEAPP
             if (num_sessions == 0)
             {
                 LOG_FTL("Document [" << anonymizeUrl(_url) << "] has no more views, exiting bluntly.");
@@ -1534,7 +1534,7 @@ private:
         if (viewCount == 1)
         {
             std::unique_lock<std::mutex> lock(_mutex);
-#ifndef MOBILEAPP
+#if !MOBILEAPP
             if (_sessions.empty())
             {
                 LOG_INF("Document [" << anonymizeUrl(_url) << "] has no more views, exiting bluntly.");
@@ -1994,7 +1994,7 @@ private:
         Util::setThreadName("lokit_" + _docId);
 
         LOG_DBG("Thread started.");
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         // Update memory stats and editor every 5 seconds.
         const int memStatsPeriodMs = 5000;
         auto lastMemStatsTime = std::chrono::steady_clock::now();
@@ -2007,7 +2007,7 @@ private:
                 const TileQueue::Payload input = _tileQueue->get(POLL_TIMEOUT_MS * 2);
                 if (input.empty())
                 {
-#ifndef MOBILEAPP
+#if !MOBILEAPP
                     auto duration = (std::chrono::steady_clock::now() - lastMemStatsTime);
                     std::chrono::milliseconds::rep durationMs = std::chrono::duration_cast<std::chrono::milliseconds>(duration).count();
                     if (durationMs > memStatsPeriodMs)
@@ -2241,7 +2241,7 @@ protected:
     {
         std::string message(data.data(), data.size());
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         if (UnitKit::get().filterKitMessage(this, message))
             return;
 #endif
@@ -2316,7 +2316,7 @@ protected:
         }
         else if (tokens.size() == 3 && tokens[0] == "setconfig")
         {
-#ifndef MOBILEAPP
+#if !MOBILEAPP
             // Currently onlly rlimit entries are supported.
             if (!Rlimit::handleSetrlimitCommand(tokens))
             {
@@ -2332,7 +2332,7 @@ protected:
 
     void onDisconnect() override
     {
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         LOG_WRN("Kit connection lost without exit arriving from wsd. Setting TerminationFlag");
         TerminationFlag = true;
 #endif
@@ -2347,7 +2347,7 @@ void documentViewCallback(const int type, const char* payload, void* data)
 #ifndef BUILDING_TESTS
 
 void lokit_main(
-#ifndef MOBILEAPP
+#if !MOBILEAPP
                 const std::string& childRoot,
                 const std::string& jailId,
                 const std::string& sysTemplate,
@@ -2363,7 +2363,7 @@ void lokit_main(
 #endif
                 )
 {
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 
 #ifndef FUZZER
     SigUtil::setFatalSignals();
@@ -2424,7 +2424,7 @@ void lokit_main(
 
     try
     {
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         jailPath = Path::forDirectory(childRoot + "/" + jailId);
         LOG_INF("Jail path: " << jailPath.toString());
         File(jailPath).createDirectories();
@@ -2644,7 +2644,7 @@ void lokit_main(
 
         std::shared_ptr<SocketHandlerInterface> websocketHandler =
             std::make_shared<KitWebSocketHandler>("child_ws", loKit, jailId, mainKit);
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         mainKit.insertNewUnixSocket(MasterLocation, pathAndQuery, websocketHandler);
 #else
         mainKit.insertNewFakeSocket(docBrokerSocket, websocketHandler);
@@ -2652,7 +2652,7 @@ void lokit_main(
 
         LOG_INF("New kit client websocket inserted.");
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         if (bTraceStartup && LogLevel != "trace")
         {
             LOG_INF("Kit initialization complete: setting log-level to [" << LogLevel << "] as configured.");
@@ -2664,7 +2664,7 @@ void lokit_main(
         {
             mainKit.poll(SocketPoll::DefaultPollTimeoutMs);
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
             if (document && document->purgeSessions() == 0)
             {
                 LOG_INF("Last session discarded. Setting TerminationFlag");
@@ -2675,7 +2675,7 @@ void lokit_main(
 
         LOG_INF("Kit poll terminated.");
 
-#ifdef MOBILEAPP
+#if MOBILEAPP
         SocketPoll::wakeupWorld();
 #endif
 
@@ -2691,7 +2691,7 @@ void lokit_main(
         LOG_ERR("Exception: " << exc.what());
     }
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 
     // Trap the signal handler, if invoked,
     // to prevent exiting.
@@ -2713,7 +2713,7 @@ std::string anonymizeUrl(const std::string& url)
 #endif
 }
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 
 /// Initializes LibreOfficeKit for cross-fork re-use.
 bool globalPreinit(const std::string &loTemplate)
diff --git a/kit/Kit.hpp b/kit/Kit.hpp
index efd768f14..58dfd9e55 100644
--- a/kit/Kit.hpp
+++ b/kit/Kit.hpp
@@ -14,7 +14,7 @@
 
 #include <common/Util.hpp>
 
-#ifdef MOBILEAPP
+#if MOBILEAPP
 
 #include "ClientSession.hpp"
 #include "DocumentBroker.hpp"
@@ -23,7 +23,7 @@
 #endif
 
 void lokit_main(
-#ifndef MOBILEAPP
+#if !MOBILEAPP
                 const std::string& childRoot,
                 const std::string& jailId,
                 const std::string& sysTemplate,
diff --git a/net/FakeSocket.hpp b/net/FakeSocket.hpp
index 11470f6da..8ad1d48f1 100644
--- a/net/FakeSocket.hpp
+++ b/net/FakeSocket.hpp
@@ -10,7 +10,7 @@
 #ifndef INCLUDED_FAKESOCKET_H
 #define INCLUDED_FAKESOCKET_H
 
-#ifdef MOBILEAPP
+#if MOBILEAPP
 
 #include <string>
 
diff --git a/net/ServerSocket.hpp b/net/ServerSocket.hpp
index f91e3a505..a0d45b453 100644
--- a/net/ServerSocket.hpp
+++ b/net/ServerSocket.hpp
@@ -48,7 +48,7 @@ public:
     /// Returns true on success only.
     bool listen(const int backlog = 64)
     {
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         const int rc = ::listen(getFD(), backlog);
 #else
         const int rc = fakeSocketListen(getFD());
@@ -96,7 +96,7 @@ protected:
     std::shared_ptr<SocketFactory> _sockFactory;
 };
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 
 /// A non-blocking, streaming Unix Domain Socket for local use
 class LocalServerSocket : public ServerSocket
diff --git a/net/Socket.cpp b/net/Socket.cpp
index 4b9242a98..dbab15d08 100644
--- a/net/Socket.cpp
+++ b/net/Socket.cpp
@@ -30,7 +30,7 @@
 
 #include <SigUtil.hpp>
 #include "ServerSocket.hpp"
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 #include "SslSocket.hpp"
 #endif
 #include "WebSocketHandler.hpp"
@@ -43,7 +43,7 @@ std::atomic<bool> Socket::InhibitThreadChecks(false);
 
 int Socket::createSocket(Socket::Type type)
 {
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     int domain = AF_UNSPEC;
     switch (type)
     {
@@ -83,7 +83,7 @@ SocketPoll::SocketPoll(const std::string& threadName)
 {
     // Create the wakeup fd.
     if (
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         ::pipe2(_wakeup, O_CLOEXEC | O_NONBLOCK) == -1
 #else
         fakeSocketPipe2(_wakeup) == -1
@@ -111,7 +111,7 @@ SocketPoll::~SocketPoll()
             getWakeupsArray().erase(it);
     }
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     ::close(_wakeup[0]);
     ::close(_wakeup[1]);
 #else
@@ -201,7 +201,7 @@ void SocketPoll::wakeupWorld()
         wakeup(fd);
 }
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 
 void SocketPoll::insertNewWebSocketSync(
     const Poco::URI &uri,
@@ -438,7 +438,7 @@ void SocketPoll::dumpState(std::ostream& os)
 /// Returns true on success only.
 bool ServerSocket::bind(Type type, int port)
 {
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     // Enable address reuse to avoid stalling after
     // recycling, when previous socket is TIME_WAIT.
     //TODO: Might be worth refactoring out.
@@ -493,7 +493,7 @@ std::shared_ptr<Socket> ServerSocket::accept()
 {
     // Accept a connection (if any) and set it to non-blocking.
     // There still need the client's address to filter request from POST(call from REST) here.
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     assert(_type != Socket::Type::Unix);
 
     struct sockaddr_in6 clientInfo;
@@ -510,7 +510,7 @@ std::shared_ptr<Socket> ServerSocket::accept()
         {
             std::shared_ptr<Socket> _socket = _sockFactory->create(rc);
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
             char addrstr[INET6_ADDRSTRLEN];
 
             const void *inAddr;
@@ -543,7 +543,7 @@ std::shared_ptr<Socket> ServerSocket::accept()
     return nullptr;
 }
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 
 int Socket::getPid() const
 {
diff --git a/net/Socket.hpp b/net/Socket.hpp
index 55925fbf5..9f9c74c7d 100644
--- a/net/Socket.hpp
+++ b/net/Socket.hpp
@@ -116,7 +116,7 @@ public:
         LOG_TRC("#" << getFD() << " Socket dtor.");
 
         // Doesn't block on sockets; no error handling needed.
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         ::close(_fd);
 #else
         fakeSocketClose(_fd);
@@ -144,7 +144,7 @@ public:
     virtual void shutdown()
     {
         LOG_TRC("#" << _fd << ": socket shutdown RDWR.");
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         ::shutdown(_fd, SHUT_RDWR);
 #else
         fakeSocketShutdown(_fd);
@@ -165,14 +165,14 @@ public:
     /// manage latency issues around packet aggregation
     void setNoDelay()
     {
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         const int val = 1;
         ::setsockopt(_fd, IPPROTO_TCP, TCP_NODELAY,
                      (char *) &val, sizeof(val));
 #endif
     }
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     /// Uses peercreds to get prisoner PID if present or -1
     int getPid() const;
 
@@ -221,14 +221,14 @@ public:
     /// Gets our fast cache of the socket buffer size
     int getSendBufferSize() const
     {
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         return _sendBufferSize;
 #else
         return INT_MAX; // We want to always send a single record in one go
 #endif
     }
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     /// Sets the receive buffer size in bytes.
     /// Note: TCP will allocate twice this size for admin purposes,
     /// so a subsequent call to getReceieveBufferSize will return
@@ -321,7 +321,7 @@ protected:
         _owner = std::this_thread::get_id();
         LOG_DBG("#" << _fd << " Thread affinity set to " << Log::to_string(_owner) << ".");
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 #if ENABLE_DEBUG
         if (std::getenv("LOOL_ZERO_BUFFER_SIZE"))
         {
@@ -404,7 +404,7 @@ public:
     {
         LOG_DBG("Stopping " << _name << ".");
         _stop = true;
-#ifdef MOBILEAPP
+#if MOBILEAPP
         {
             // We don't want to risk some callbacks in _newCallbacks being invoked when we start
             // running a thread for this SocketPoll again.
@@ -489,7 +489,7 @@ public:
         do
         {
             LOG_TRC("Poll start");
-#ifndef MOBILEAPP
+#if !MOBILEAPP
             rc = ::poll(&_pollFds[0], size + 1, std::max(timeoutMaxMs,0));
 #else
             LOG_TRC("SocketPoll Poll");
@@ -508,7 +508,7 @@ public:
                 std::lock_guard<std::mutex> lock(_mutex);
 
                 // Clear the data.
-#ifndef MOBILEAPP
+#if !MOBILEAPP
                 int dump = ::read(_wakeup[0], &dump, sizeof(dump));
 #else
                 LOG_TRC("Wakeup pipe read");
@@ -592,7 +592,7 @@ public:
         // wakeup the main-loop.
         int rc;
         do {
-#ifndef MOBILEAPP
+#if !MOBILEAPP
             rc = ::write(fd, "w", 1);
 #else
 #if 0
@@ -646,7 +646,7 @@ public:
         }
     }
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     /// Inserts a new remote websocket to be polled.
     /// NOTE: The DNS lookup is synchronous.
     void insertNewWebSocketSync(const Poco::URI &uri,
@@ -879,7 +879,7 @@ public:
     {
         assertCorrectThread();
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         // SSL decodes blocks of 16Kb, so for efficiency we use the same.
         char buf[16 * 1024];
         ssize_t len;
@@ -1100,7 +1100,7 @@ protected:
     virtual int readData(char* buf, int len)
     {
         assertCorrectThread();
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         return ::read(getFD(), buf, len);
 #else
         return fakeSocketRead(getFD(), buf, len);
@@ -1111,7 +1111,7 @@ protected:
     virtual int writeData(const char* buf, const int len)
     {
         assertCorrectThread();
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         return ::write(getFD(), buf, len);
 #else
         struct pollfd p;
diff --git a/net/WebSocketHandler.hpp b/net/WebSocketHandler.hpp
index 4152f8999..3b65ee89a 100644
--- a/net/WebSocketHandler.hpp
+++ b/net/WebSocketHandler.hpp
@@ -113,7 +113,7 @@ public:
                 static_cast<unsigned>(statusCode) << ", message: " << statusMessage);
         _shuttingDown = true;
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         const size_t len = statusMessage.size();
         std::vector<char> buf(2 + len);
         buf[0] = ((((int)statusCode) >> 8) & 0xff);
@@ -136,7 +136,7 @@ public:
         if (len == 0)
             return false; // avoid logging.
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         if (len < 2) // partial read
         {
             LOG_TRC("#" << socket->getFD() << ": Still incomplete WebSocket message, have " << len << " bytes");
@@ -218,7 +218,7 @@ public:
         socket->getInBuffer().erase(socket->getInBuffer().begin(),
                                     socket->getInBuffer().begin() + headerLen + payloadLen);
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 
         // FIXME: fin, aggregating payloads into _wsPayload etc.
         LOG_TRC("#" << socket->getFD() << ": Incoming WebSocket message code "
@@ -274,7 +274,7 @@ public:
 
 #endif
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         if (doClose)
         {
             if (!_shuttingDown)
@@ -316,7 +316,7 @@ public:
 
         std::shared_ptr<StreamSocket> socket = _socket.lock();
 
-#ifdef MOBILEAPP
+#if MOBILEAPP
         // No separate "upgrade" is going on
         if (socket != nullptr && !socket->isWebSocket())
             socket->setWebSocket();
@@ -326,7 +326,7 @@ public:
         {
             LOG_ERR("No socket associated with WebSocketHandler " << this);
         }
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         else if (_isClient && !socket->isWebSocket())
             handleClientUpgrade();
 #endif
@@ -349,7 +349,7 @@ public:
         return POLLIN;
     }
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     /// Send a ping message
     void sendPingOrPong(std::chrono::steady_clock::time_point now,
                         const char* data, const size_t len,
@@ -392,7 +392,7 @@ public:
     /// Do we need to handle a timeout ?
     void checkTimeout(std::chrono::steady_clock::time_point now) override
     {
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         if (_isClient)
             return;
 
@@ -449,7 +449,7 @@ private:
         socket->assertCorrectThread();
         std::vector<char>& out = socket->getOutBuffer();
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         const size_t oldSize = out.size();
 
         out.push_back(flags);
@@ -555,7 +555,7 @@ protected:
         LOG_TRC("#" << socket->getFD() << ": Upgrading to WebSocket.");
         assert(!socket->isWebSocket());
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         // create our websocket goodness ...
         const int wsVersion = std::stoi(req.get("Sec-WebSocket-Version", "13"));
         const std::string wsKey = req.get("Sec-WebSocket-Key", "");
@@ -583,7 +583,7 @@ protected:
         setWebSocket();
     }
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     // Handle incoming upgrade to full socket as client WS.
     void handleClientUpgrade()
     {
diff --git a/test/fakesockettest.cpp b/test/fakesockettest.cpp
index 5d7efc2c4..e425b4d4d 100644
--- a/test/fakesockettest.cpp
+++ b/test/fakesockettest.cpp
@@ -25,8 +25,9 @@
 #include <cppunit/extensions/HelperMacros.h>
 #include <cppunit/extensions/TestFactoryRegistry.h>
 
-#define MOBILEAPP // A bit ugly, but currently FakeSocket.hpp is surrounded by a MOBILEAPP ifdef,
-                  // and probably it is not a good idea to remove that?
+#undef MOBILEAPP
+#define MOBILEAPP 1 // A bit ugly, but currently FakeSocket.hpp is surrounded by a MOBILEAPP ifdef,
+                    // and probably it is not a good idea to remove that?
 #include "FakeSocket.hpp"
 
 class FakeSocketTest : public CPPUNIT_NS::TestFixture
diff --git a/wsd/Auth.hpp b/wsd/Auth.hpp
index 3659a6d38..1220aee21 100644
--- a/wsd/Auth.hpp
+++ b/wsd/Auth.hpp
@@ -14,7 +14,7 @@
 #include <cassert>
 #include <string>
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 #include <Poco/Crypto/RSADigestEngine.h>
 #include <Poco/Crypto/RSAKey.h>
 #endif
@@ -33,7 +33,7 @@ public:
     virtual bool verify(const std::string& token) = 0;
 };
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 
 /// JWT Authorization.
 class JWTAuth : public AuthBase
diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index 30c0aa646..c7e99f7fb 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -727,7 +727,7 @@ bool ClientSession::handleKitToClientMessage(const char* buffer, const int lengt
         return false;
     }
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     LOOLWSD::dumpOutgoingTrace(docBroker->getJailId(), getId(), firstLine);
 #endif
 
@@ -818,7 +818,7 @@ bool ClientSession::handleKitToClientMessage(const char* buffer, const int lengt
                 return false;
          }
     }
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     else if (tokens.size() == 3 && tokens[0] == "saveas:")
     {
         bool isConvertTo = static_cast<bool>(_saveAsSocket);
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 139f13fc2..1d70693bd 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -215,7 +215,7 @@ void DocumentBroker::pollThread()
     _threadStart = std::chrono::steady_clock::now();
 
     // Request a kit process for this doc.
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     do
     {
         static const int timeoutMs = COMMAND_TIMEOUT_MS * 5;
@@ -264,7 +264,7 @@ void DocumentBroker::pollThread()
 
     static const bool AutoSaveEnabled = !std::getenv("LOOL_NO_AUTOSAVE");
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     static const size_t IdleDocTimeoutSecs = LOOLWSD::getConfigValue<int>(
                                                       "per_document.idle_timeout_secs", 3600);
 
@@ -285,7 +285,7 @@ void DocumentBroker::pollThread()
 
         const auto now = std::chrono::steady_clock::now();
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         if (!_isLoaded && (limit_load_secs > 0) && (now > loadDeadline))
         {
             // Brutal but effective.
@@ -396,7 +396,7 @@ void DocumentBroker::pollThread()
     _poll->stop();
     _poll->removeSockets();
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     // Async cleanup.
     LOOLWSD::doHousekeeping();
 #endif
@@ -421,7 +421,7 @@ DocumentBroker::~DocumentBroker()
 {
     assertCorrectThread();
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     Admin::instance().rmDoc(_docKey);
 #endif
 
@@ -509,7 +509,7 @@ bool DocumentBroker::load(const std::shared_ptr<ClientSession>& session, const s
     std::string userExtraInfo;
     std::string watermarkText;
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     std::chrono::duration<double> getInfoCallDuration(0);
     WopiStorage* wopiStorage = dynamic_cast<WopiStorage*>(_storage.get());
     if (wopiStorage != nullptr)
@@ -664,7 +664,7 @@ bool DocumentBroker::load(const std::shared_ptr<ClientSession>& session, const s
     {
         std::string localPath = _storage->loadStorageFileToLocal(session->getAuthorization());
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         // Check if we have a prefilter "plugin" for this document format
         for (const auto& plugin : LOOLWSD::PluginConfigurations)
         {
@@ -740,7 +740,7 @@ bool DocumentBroker::load(const std::shared_ptr<ClientSession>& session, const s
         _tileCache->setThreadOwner(std::this_thread::get_id());
     }
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     LOOLWSD::dumpNewSessionTrace(getJailId(), sessionId, _uriOrig, _storage->getRootFilePath());
 
     // Since document has been loaded, send the stats if its WOPI
@@ -1140,7 +1140,7 @@ size_t DocumentBroker::addSessionInternal(const std::shared_ptr<ClientSession>&
     const std::string aMessage = "session " + id + ' ' + _docKey + ' ' + _docId;
     _childProcess->sendTextFrame(aMessage);
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     // Tell the admin console about this new doc
     Admin::instance().addDoc(_docKey, getPid(), getFilename(), id, session->getUserName(), session->getUserId());
 #endif
@@ -1196,13 +1196,13 @@ size_t DocumentBroker::removeSessionInternal(const std::string& id)
     assertCorrectThread();
     try
     {
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         Admin::instance().rmDoc(_docKey, id);
 #endif
         auto it = _sessions.find(id);
         if (it != _sessions.end())
         {
-#ifndef MOBILEAPP
+#if !MOBILEAPP
             LOOLWSD::dumpEndSessionTrace(getJailId(), id, _uriOrig);
 #endif
 
@@ -1278,7 +1278,7 @@ bool DocumentBroker::handleInput(const std::vector<char>& payload)
     const auto& msg = message->abbr();
     LOG_TRC("DocumentBroker handling child message: [" << msg << "].");
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     LOOLWSD::dumpOutgoingTrace(getJailId(), "0", msg);
 #endif
 
@@ -1307,7 +1307,7 @@ bool DocumentBroker::handleInput(const std::vector<char>& payload)
             LOG_CHECK_RET(kind != "", false);
             Util::alertAllUsers(cmd, kind);
         }
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         else if (command == "procmemstats:")
         {
             int dirty;
@@ -1681,7 +1681,7 @@ void DocumentBroker::setModified(const bool value)
     if (_isModified != value)
     {
         _isModified = value;
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         Admin::instance().modificationAlert(_docKey, getPid(), value);
 #endif
     }
@@ -1871,7 +1871,7 @@ void DocumentBroker::broadcastMessage(const std::string& message)
 void DocumentBroker::updateLastActivityTime()
 {
     _lastActivityTime = std::chrono::steady_clock::now();
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     Admin::instance().updateLastActivityTime(_docKey);
 #endif
 }
diff --git a/wsd/DocumentBroker.hpp b/wsd/DocumentBroker.hpp
index 2090b7ec2..5f20cdc7a 100644
--- a/wsd/DocumentBroker.hpp
+++ b/wsd/DocumentBroker.hpp
@@ -129,7 +129,7 @@ public:
         if (_pid < 0)
             return;
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         if (::kill(_pid, 0) == 0)
         {
             LOG_INF("Killing child [" << _pid << "].");
@@ -176,7 +176,7 @@ public:
     /// time after the other end-point closes. So this isn't accurate.
     bool isAlive() const
     {
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         try
         {
             return _pid > 1 && _ws && ::kill(_pid, 0) == 0;
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 5b9ac3b42..eb2074f7e 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -49,7 +49,7 @@
 #include <sstream>
 #include <thread>
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 
 #include <Poco/Net/Context.h>
 #include <Poco/Net/HTMLForm.h>
@@ -110,7 +110,7 @@ using Poco::Net::PartHandler;
 #include "FileServer.hpp"
 #include <FileUtil.hpp>
 #include <IoUtil.hpp>
-#if defined KIT_IN_PROCESS || defined MOBILEAPP
+#if defined KIT_IN_PROCESS || MOBILEAPP
 #  include <Kit.hpp>
 #endif
 #include <Log.hpp>
@@ -134,7 +134,7 @@ using Poco::Net::PartHandler;
 
 #include <ServerSocket.hpp>
 
-#ifdef MOBILEAPP
+#if MOBILEAPP
 #ifdef IOS
 #include "ios.h"
 #elif GTKAPP
@@ -214,7 +214,7 @@ std::atomic<unsigned> LOOLWSD::NumConnections;
 std::string LOOLWSD::Cache = LOOLWSD_CACHEDIR;
 std::set<std::string> LOOLWSD::EditFileExtensions;
 
-#ifdef MOBILEAPP
+#if MOBILEAPP
 
 // Or can this be retreieved in some other way?
 int LOOLWSD::prisonerServerSocketFD;
@@ -256,7 +256,7 @@ inline void shutdownLimitReached(WebSocketHandler& ws)
 
 inline void checkSessionLimitsAndWarnClients()
 {
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     size_t docBrokerCount = DocBrokers.size() - ConvertToBroker::getInstanceCount();
     if (docBrokerCount > LOOLWSD::MaxDocuments || LOOLWSD::NumConnections >= LOOLWSD::MaxConnections)
     {
@@ -275,7 +275,7 @@ inline void checkSessionLimitsAndWarnClients()
 #endif
 }
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 /// Internal implementation to alert all clients
 /// connected to any document.
 void alertAllUsersInternal(const std::string& msg)
@@ -298,7 +298,7 @@ void alertAllUsersInternal(const std::string& msg)
 
 static void checkDiskSpaceAndWarnClients(const bool cacheLastCheck)
 {
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     try
     {
         const std::string fs = FileUtil::checkDiskSpaceOnRegisteredFileSystems(cacheLastCheck);
@@ -356,7 +356,7 @@ void cleanupDocBrokers()
     }
 }
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 
 /// Forks as many children as requested.
 /// Returns the number of children requested to spawn,
@@ -480,7 +480,7 @@ static size_t addNewChild(const std::shared_ptr<ChildProcess>& child)
 }
 
 std::shared_ptr<ChildProcess> getNewChild_Blocks(
-#ifdef MOBILEAPP
+#if MOBILEAPP
                                                  const std::string& uri
 #endif
                                                  )
@@ -489,7 +489,7 @@ std::shared_ptr<ChildProcess> getNewChild_Blocks(
 
     const auto startTime = std::chrono::steady_clock::now();
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     LOG_DBG("getNewChild: Rebalancing children.");
     int numPreSpawn = LOOLWSD::NumPreSpawnedChildren;
     ++numPreSpawn; // Replace the one we'll dispatch just now.
@@ -558,7 +558,7 @@ std::shared_ptr<ChildProcess> getNewChild_Blocks(
     return nullptr;
 }
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 
 /// Handles the filename part of the convert-to POST request payload,
 /// Also owns the file - cleaning it up when destroyed.
@@ -742,7 +742,7 @@ LOOLWSD::~LOOLWSD()
 
 void LOOLWSD::initialize(Application& self)
 {
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     if (geteuid() == 0)
     {
         throw std::runtime_error("Do not run as root. Please run as lool user.");
@@ -835,7 +835,7 @@ void LOOLWSD::initialize(Application& self)
     AutoPtr<AppConfigMap> defConfig(new AppConfigMap(DefAppConfig));
     conf.addWriteable(defConfig, PRIO_SYSTEM); // Lowest priority
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 
     // Load default configuration files, if present.
     if (loadConfiguration(PRIO_DEFAULT) == 0)
@@ -1044,7 +1044,7 @@ void LOOLWSD::initialize(Application& self)
     }
     LOG_INF("NumPreSpawnedChildren set to " << NumPreSpawnedChildren << ".");
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     const auto maxConcurrency = getConfigValue<int>(conf, "per_document.max_concurrency", 4);
     if (maxConcurrency > 0)
     {
@@ -1154,13 +1154,13 @@ void LOOLWSD::initialize(Application& self)
         TraceDumper.reset(new TraceFileWriter(path, recordOutgoing, compress, takeSnapshot, filters));
     }
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     FileServerRequestHandler::initialize();
 #endif
 
     StorageBase::initialize();
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     ServerApplication::initialize(self);
 
     DocProcSettings docProcSettings;
@@ -1268,7 +1268,7 @@ void LOOLWSD::dumpOutgoingTrace(const std::string& id, const std::string& sessio
 
 void LOOLWSD::defineOptions(OptionSet& optionSet)
 {
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     ServerApplication::defineOptions(optionSet);
 
     optionSet.addOption(Option("help", "", "Display help information on command line arguments.")
@@ -1331,7 +1331,7 @@ void LOOLWSD::defineOptions(OptionSet& optionSet)
 void LOOLWSD::handleOption(const std::string& optionName,
                            const std::string& value)
 {
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     ServerApplication::handleOption(optionName, value);
 
     if (optionName == "help")
@@ -1380,7 +1380,7 @@ void LOOLWSD::handleOption(const std::string& optionName,
 #endif
 }
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 
 void LOOLWSD::displayHelp()
 {
@@ -1513,7 +1513,7 @@ void LOOLWSD::autoSave(const std::string& docKey)
 /// Really do the house-keeping
 void PrisonerPoll::wakeupHook()
 {
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     if (!LOOLWSD::checkAndRestoreForKit())
     {
         // No children have died.
@@ -1549,7 +1549,7 @@ void PrisonerPoll::wakeupHook()
         cleanupDocBrokers();
 }
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 
 bool LOOLWSD::createForKit()
 {
@@ -1832,7 +1832,7 @@ private:
 
         try
         {
-#ifndef MOBILEAPP
+#if !MOBILEAPP
             size_t requestSize = 0;
 
             if (!socket->parseHeader("Prisoner", message, request, &requestSize))
@@ -2033,7 +2033,7 @@ private:
         // LOG_TRC("***** ClientRequestDispatcher::handleIncomingMessage()");
         std::shared_ptr<StreamSocket> socket = _socket.lock();
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         if (!LOOLWSD::isSSLEnabled() && socket->sniffSSL())
         {
             LOG_ERR("Looks like SSL/TLS traffic on plain http port");
@@ -2186,7 +2186,7 @@ private:
     {
     }
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     void handleFileServerRequest(const Poco::Net::HTTPRequest& request, Poco::MemoryInputStream& message)
     {
         std::shared_ptr<StreamSocket> socket = _socket.lock();
@@ -2727,7 +2727,7 @@ private:
     /// Process the discovery.xml file and return as string.
     static std::string getDiscoveryXML()
     {
-#if defined __linux && defined MOBILEAPP
+#if defined __linux && MOBILEAPP
         // discovery.xml is in the top directory
         std::string discoveryPath = Path(Application::instance().commandPath()).parent().parent().toString() + "discovery.xml";
 #else
@@ -2826,7 +2826,7 @@ class PlainSocketFactory final : public SocketFactory
     std::shared_ptr<Socket> create(const int physicalFd) override
     {
         int fd = physicalFd;
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         if (SimulatedLatencyMs > 0)
             fd = Delay::create(SimulatedLatencyMs, physicalFd);
 #endif
@@ -2845,7 +2845,7 @@ class SslSocketFactory final : public SocketFactory
     {
         int fd = physicalFd;
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         if (SimulatedLatencyMs > 0)
             fd = Delay::create(SimulatedLatencyMs, physicalFd);
 #endif
@@ -2901,13 +2901,13 @@ public:
         std::shared_ptr<ServerSocket> serverSocket(findServerPort(port));
         _acceptPoll.insertNewSocket(serverSocket);
 
-#ifdef MOBILEAPP
+#if MOBILEAPP
         loolwsd_server_socket_fd = serverSocket->getFD();
 #endif
 
         WebServerPoll.startThread();
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         Admin::instance().start();
 #endif
     }
@@ -2948,7 +2948,7 @@ public:
         os << "Prisoner poll:\n";
         PrisonerPoll.dumpState(os);
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         os << "Admin poll:\n";
         Admin::instance().dumpState(os);
 
@@ -3006,7 +3006,7 @@ private:
     std::shared_ptr<ServerSocket> findPrisonerServerPort()
     {
         std::shared_ptr<SocketFactory> factory = std::make_shared<PrisonerSocketFactory>();
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         std::string location;
         auto socket = std::make_shared<LocalServerSocket>(PrisonerPoll, factory);;
 
@@ -3071,7 +3071,7 @@ private:
 
         ClientPortNumber = port;
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
         LOG_INF("Listening to client connections on port " << port);
 #else
         LOG_INF("Listening to client connections on #" << socket->getFD());
@@ -3084,7 +3084,7 @@ static LOOLWSDServer srv;
 
 int LOOLWSD::innerMain()
 {
-#if !defined FUZZER && !defined MOBILEAPP
+#if !defined FUZZER && !MOBILEAPP
     SigUtil::setUserSignals();
     SigUtil::setFatalSignals();
     SigUtil::setTerminationSignals();
@@ -3094,7 +3094,7 @@ int LOOLWSD::innerMain()
     // down-pay all the forkit linking cost once & early.
     Environment::set("LD_BIND_NOW", "1");
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     if (DisplayVersion)
     {
         std::string version, hash;
@@ -3110,7 +3110,7 @@ int LOOLWSD::innerMain()
     ::setenv("LC_ALL", "en_US.UTF-8", 1);
     setlocale(LC_ALL, "en_US.UTF-8");
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     if (access(Cache.c_str(), R_OK | W_OK | X_OK) != 0)
     {
         const auto err = "Unable to access cache [" + Cache +
@@ -3160,7 +3160,7 @@ int LOOLWSD::innerMain()
     srv.startPrisoners();
 
 // No need to "have at least one child" beforehand on mobile
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 
 #ifndef KIT_IN_PROCESS
     {
@@ -3284,7 +3284,7 @@ int LOOLWSD::innerMain()
 
     DocBrokers.clear();
 
-#if !defined(KIT_IN_PROCESS) && !defined(MOBILEAPP)
+#if !defined(KIT_IN_PROCESS) && !MOBILEAPP
     // Terminate child processes
     LOG_INF("Requesting forkit process " << ForKitProcId << " to terminate.");
     SigUtil::killChild(ForKitProcId);
@@ -3299,7 +3299,7 @@ int LOOLWSD::innerMain()
         child->terminate();
     }
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 #ifndef KIT_IN_PROCESS
     // Wait for forkit process finish.
     LOG_INF("Waiting for forkit process to exit");
@@ -3326,7 +3326,7 @@ int LOOLWSD::innerMain()
 
 void LOOLWSD::cleanup()
 {
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     FileServerRequestHandler::uninitialize();
 
 #if ENABLE_SSL
@@ -3343,7 +3343,7 @@ void LOOLWSD::cleanup()
 
 int LOOLWSD::main(const std::vector<std::string>& /*args*/)
 {
-#ifdef MOBILEAPP
+#if MOBILEAPP
     TerminationFlag = false;
 #endif
 
@@ -3365,14 +3365,14 @@ int LOOLWSD::main(const std::vector<std::string>& /*args*/)
 
     LOG_INF("Process [loolwsd] finished.");
 
-#ifdef MOBILEAPP
+#if MOBILEAPP
     fakeSocketDumpState();
 #endif
 
     return returnValue;
 }
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 
 void UnitWSD::testHandleRequest(TestRequest type, UnitHTTPServerRequest& /* request */, UnitHTTPServerResponse& /* response */)
 {
@@ -3431,7 +3431,7 @@ void dump_state()
     LOG_TRC(msg);
 }
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 
 POCO_SERVER_MAIN(LOOLWSD)
 
diff --git a/wsd/LOOLWSD.hpp b/wsd/LOOLWSD.hpp
index cadc0e66f..ce5f8d172 100644
--- a/wsd/LOOLWSD.hpp
+++ b/wsd/LOOLWSD.hpp
@@ -29,7 +29,7 @@ class TraceFileWriter;
 class DocumentBroker;
 
 std::shared_ptr<ChildProcess> getNewChild_Blocks(
-#ifdef MOBILEAPP
+#if MOBILEAPP
                                                  const std::string& uri
 #endif
                                                  );
@@ -249,7 +249,7 @@ private:
     /// Settings passed from the command-line to override those in the config file.
     std::map<std::string, std::string> _overrideSettings;
 
-#ifdef MOBILEAPP
+#if MOBILEAPP
 public:
     static int prisonerServerSocketFD;
 #endif
diff --git a/wsd/Storage.cpp b/wsd/Storage.cpp
index 9d53e339b..0f04c91b8 100644
--- a/wsd/Storage.cpp
+++ b/wsd/Storage.cpp
@@ -24,7 +24,7 @@
 #include <Poco/JSON/Object.h>
 #include <Poco/JSON/Parser.h>
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 
 #include <Poco/Net/AcceptCertificateHandler.h>
 #include <Poco/Net/Context.h>
@@ -59,7 +59,7 @@ bool StorageBase::FilesystemEnabled;
 bool StorageBase::WopiEnabled;
 Util::RegexListMatcher StorageBase::WopiHosts;
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 
 std::string StorageBase::getLocalRootPath() const
 {
@@ -86,7 +86,7 @@ size_t StorageBase::getFileSize(const std::string& filename)
 
 void StorageBase::initialize()
 {
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     const auto& app = Poco::Util::Application::instance();
     FilesystemEnabled = app.config().getBool("storage.filesystem[@allow]", false);
 
@@ -146,7 +146,7 @@ bool StorageBase::allowedWopiHost(const std::string& host)
     return WopiEnabled && WopiHosts.match(host);
 }
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 
 bool isLocalhost(const std::string& targetHost)
 {
@@ -238,7 +238,7 @@ std::unique_ptr<StorageBase> StorageBase::create(const Poco::URI& uri, const std
 
         LOG_ERR("Local Storage is disabled by default. Enable in the config file or on the command-line to enable.");
     }
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     else if (WopiEnabled)
     {
         LOG_INF("Public URI [" << LOOLWSD::anonymizeUrl(uri.toString()) << "] considered WOPI.");
@@ -274,7 +274,7 @@ std::unique_ptr<LocalStorage::LocalFileInfo> LocalStorage::getLocalFileInfo()
 
 std::string LocalStorage::loadStorageFileToLocal(const Authorization& /*auth*/)
 {
-#ifndef MOBILEAPP
+#if !MOBILEAPP
     // /chroot/jailId/user/doc/childId/file.ext
     const std::string filename = Poco::Path(getUri().getPath()).getFileName();
     setRootFilePath(Poco::Path(getLocalRootPath(), filename).toString());
@@ -363,7 +363,7 @@ StorageBase::SaveResult LocalStorage::saveLocalFileToStorage(const Authorization
     return StorageBase::SaveResult(StorageBase::SaveResult::OK);
 }
 
-#ifndef MOBILEAPP
+#if !MOBILEAPP
 
 namespace
 {


More information about the Libreoffice-commits mailing list