summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-05-31 01:48:18 +0300
committerAndrei Karas <akaras@inbox.ru>2016-05-31 01:48:18 +0300
commitd53b058ec3f6208f34884ed572bb5d47de932108 (patch)
tree980acf66aaa3b5df6b7e3e7e08dfccc0b9af8827 /src/utils
parent4530a341c65ac12e50075fb3e3d6166cd2e1fe3b (diff)
downloadmv-d53b058ec3f6208f34884ed572bb5d47de932108.tar.gz
mv-d53b058ec3f6208f34884ed572bb5d47de932108.tar.bz2
mv-d53b058ec3f6208f34884ed572bb5d47de932108.tar.xz
mv-d53b058ec3f6208f34884ed572bb5d47de932108.zip
Fix different include issues.
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/copynpaste.cpp31
-rw-r--r--src/utils/paths.cpp3
2 files changed, 20 insertions, 14 deletions
diff --git a/src/utils/copynpaste.cpp b/src/utils/copynpaste.cpp
index 8bce3a4c0..b27768422 100644
--- a/src/utils/copynpaste.cpp
+++ b/src/utils/copynpaste.cpp
@@ -35,17 +35,32 @@
#include "utils/copynpaste.h"
+#include "debug.h"
+
+#ifdef USE_SDL2
+#include <SDL_clipboard.h>
+
+#else // USE_SDL2
+
+#if defined(__APPLE__)
+#ifdef Status
+#undef Status
+#endif
+#include <Carbon/Carbon.h>
+#elif defined USE_X11
#include "render/graphics.h"
#include "utils/sdlhelper.h"
#include <SDL_syswm.h>
+#include <unistd.h>
+#elif defined __native_client__
+#include "utils/naclmessages.h"
+#endif
-#include "debug.h"
+#endif // USE_SDL2
#ifdef USE_SDL2
-#include <SDL_clipboard.h>
-
bool retrieveBuffer(std::string& text, size_t& pos)
{
char *buf = SDL_GetClipboardText();
@@ -155,12 +170,6 @@ bool sendBuffer(const std::string &restrict text)
#elif defined(__APPLE__)
-#ifdef Status
-#undef Status
-#endif
-
-#include <Carbon/Carbon.h>
-
// Sorry for the very long code, all nicer OS X APIs are coded in
// Objective C and not C!
// Also it does very thorough error handling
@@ -300,8 +309,6 @@ bool sendBuffer(const std::string &restrict text)
#elif defined USE_X11
-#include <unistd.h>
-
static char* getSelection2(Display *const dpy, Window us, Atom selection,
Atom request_target)
{
@@ -472,8 +479,6 @@ static bool runxsel(const std::string &text, const char *p1, const char *p2)
#elif defined __native_client__
-#include "utils/naclmessages.h"
-
bool retrieveBuffer(std::string& text, size_t& pos)
{
NaclMessageHandle *handle = naclRegisterMessageHandler("clipboard-paste");
diff --git a/src/utils/paths.cpp b/src/utils/paths.cpp
index 2490c853d..e5d098a42 100644
--- a/src/utils/paths.cpp
+++ b/src/utils/paths.cpp
@@ -26,11 +26,12 @@
#include "utils/paths.h"
-#include "utils/files.h"
#include "utils/physfstools.h"
#include "utils/stringutils.h"
#ifdef USE_X11
+#include "utils/files.h"
+
#include "resources/resourcemanager/resourcemanager.h"
#endif