forward declare context and remove getter error handling

This commit is contained in:
Cody Glassman 2025-08-01 17:26:38 -07:00
parent 624df21a9c
commit 9fd0a66787
2 changed files with 7 additions and 12 deletions

View File

@ -1,7 +1,7 @@
#include "clipboardbindings.hpp"
#include <SDL.h>
#include <SDL_clipboard.h>
#include <SDL_error.h>
#include <components/debug/debuglog.hpp>
@ -17,15 +17,10 @@ namespace MWLua
api["get"] = []() {
std::string text;
if (char* raw = SDL_GetClipboardText())
{
text = raw;
SDL_free(raw);
}
else
{
Log(Debug::Error) << "Failed to get clipboard content: " << SDL_GetError();
}
char* raw = SDL_GetClipboardText();
text = raw;
SDL_free(raw);
return text;
};

View File

@ -3,10 +3,10 @@
#include <sol/forward.hpp>
#include "context.hpp"
namespace MWLua
{
struct Context;
sol::table initClipboardPackage(const Context&);
}