summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
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