From 197a70c2e6dae2bb3e5f2ec19cc9fd4a3524de75 Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Sun, 16 Mar 2014 11:35:53 +0000 Subject: [PATCH] Fix Clipboard for renderer build, ensure MacOS and Windows clipboard funcs return std::string --- src/PowderToyRenderer.cpp | 4 ++-- src/PowderToySDL.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/PowderToyRenderer.cpp b/src/PowderToyRenderer.cpp index 9207ab637..5644f766f 100644 --- a/src/PowderToyRenderer.cpp +++ b/src/PowderToyRenderer.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 & storage) diff --git a/src/PowderToySDL.cpp b/src/PowderToySDL.cpp index 209b6a32f..88a680168 100644 --- a/src/PowderToySDL.cpp +++ b/src/PowderToySDL.cpp @@ -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 = "";