summaryrefslogtreecommitdiff
path: root/src/utils/copynpaste.cpp
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/copynpaste.cpp
parent4530a341c65ac12e50075fb3e3d6166cd2e1fe3b (diff)
downloadmanaverse-d53b058ec3f6208f34884ed572bb5d47de932108.tar.gz
manaverse-d53b058ec3f6208f34884ed572bb5d47de932108.tar.bz2
manaverse-d53b058ec3f6208f34884ed572bb5d47de932108.tar.xz
manaverse-d53b058ec3f6208f34884ed572bb5d47de932108.zip
Fix different include issues.
Diffstat (limited to 'src/utils/copynpaste.cpp')
-rw-r--r--src/utils/copynpaste.cpp31
1 files changed, 18 insertions, 13 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");