From d53b058ec3f6208f34884ed572bb5d47de932108 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 31 May 2016 01:48:18 +0300 Subject: Fix different include issues. --- src/utils/copynpaste.cpp | 31 ++++++++++++++++++------------- src/utils/paths.cpp | 3 ++- 2 files changed, 20 insertions(+), 14 deletions(-) (limited to 'src/utils') 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 + +#else // USE_SDL2 + +#if defined(__APPLE__) +#ifdef Status +#undef Status +#endif +#include +#elif defined USE_X11 #include "render/graphics.h" #include "utils/sdlhelper.h" #include +#include +#elif defined __native_client__ +#include "utils/naclmessages.h" +#endif -#include "debug.h" +#endif // USE_SDL2 #ifdef USE_SDL2 -#include - 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 - // 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 - 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 -- cgit v1.2.3-70-g09d2