Fix Clipboard for renderer build, ensure MacOS and Windows clipboard funcs return std::string

This commit is contained in:
Simon Robertshaw 2014-03-16 11:35:53 +00:00
parent 5b67c8ce68
commit 197a70c2e6
2 changed files with 4 additions and 4 deletions

View File

@ -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)

View File

@ -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 = "";