From 88e99dc9fd6e62a6923610cc2c55b26721221a34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20=E2=80=98Touky=E2=80=99=20Huet?= Date: Wed, 25 Sep 2013 17:32:56 +0000 Subject: [PATCH] MesssageService extern function for emscripten communication --- src/messageservice.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/messageservice.cpp b/src/messageservice.cpp index 7269ead5..24e25de0 100644 --- a/src/messageservice.cpp +++ b/src/messageservice.cpp @@ -22,6 +22,19 @@ namespace lol { +// This is needed to map MessageService::Send() to the JS when building the HTML. +#if EMSCRIPTEN +extern "C" +{ + bool C_Send(int id, const char* message) + { + return MessageService::Send(id, message); + } + //NOT IMPLEMENTED + //bool C_FetchFirst(int id, String& message); +} +#endif //EMSCRIPTEN + /* * The global g_renderer object, initialised by Video::Init */