Permalink
Browse files

Fix Clipboard for renderer build, ensure MacOS and Windows clipboard …

…funcs return std::string
  • Loading branch information...
simtr committed Mar 16, 2014
1 parent 5b67c8c commit 197a70c2e6dae2bb3e5f2ec19cc9fd4a3524de75
Showing with 4 additions and 4 deletions.
  1. +2 −2 src/PowderToyRenderer.cpp
  2. +2 −2 src/PowderToySDL.cpp
@@ -18,8 +18,8 @@
void EngineProcess() {}
void ClipboardPush(char * text) {}
char * ClipboardPull() {}
void ClipboardPush(std::string) {}
std::string ClipboardPull() {}
int GetModifiers() { return 0; }
void readFile(std::string filename, std::vector<char> & storage)
@@ -103,7 +103,7 @@ std::string ClipboardPull()
{
#ifdef MACOSX
const char *text = readClipboard();
return text ? text : "";
return text ? std::string(text) : "";
#elif defined(WIN)
if (OpenClipboard(NULL))
{
@@ -114,7 +114,7 @@ std::string ClipboardPull()
glbuffer = (char*)GlobalLock(cbuffer);
GlobalUnlock(cbuffer);
CloseClipboard();
return glbuffer ? glbuffer : "";
return glbuffer ? std::string(glbuffer) : "";
}
#elif defined(LIN) && defined(SDL_VIDEO_DRIVER_X11)
std::string text = "";

0 comments on commit 197a70c

Please sign in to comment.