these need extern C

This commit is contained in:
Chris Marsh 2017-07-07 14:00:29 -07:00
parent 7c92afb392
commit 77b0e51691
2 changed files with 7 additions and 7 deletions

View file

@ -257,7 +257,7 @@ void ConnectionWrite(const void* data, size_t length)
} // anonymous namespace } // anonymous namespace
void Discord_Initialize(const char* applicationId, DiscordEventHandlers* handlers) extern "C" void Discord_Initialize(const char* applicationId, DiscordEventHandlers* handlers)
{ {
StringCopy(ApplicationId, applicationId, sizeof(ApplicationId)); StringCopy(ApplicationId, applicationId, sizeof(ApplicationId));
if (handlers) { if (handlers) {
@ -270,13 +270,13 @@ void Discord_Initialize(const char* applicationId, DiscordEventHandlers* handler
ConnectionOpen(); ConnectionOpen();
} }
void Discord_Shutdown() extern "C" void Discord_Shutdown()
{ {
Handlers = {}; Handlers = {};
ConnectionClose(); ConnectionClose();
} }
void Discord_UpdatePresence(const DiscordRichPresence* presence) extern "C" void Discord_UpdatePresence(const DiscordRichPresence* presence)
{ {
char* jsonWrite = Frame.message; char* jsonWrite = Frame.message;

View file

@ -9,7 +9,7 @@ static DiscordEventHandlers Handlers{};
static bool wasJustConnected = false; static bool wasJustConnected = false;
static bool wasJustDisconnected = false; static bool wasJustDisconnected = false;
void Discord_Initialize(const char* applicationId, DiscordEventHandlers* handlers) extern "C" void Discord_Initialize(const char* applicationId, DiscordEventHandlers* handlers)
{ {
StringCopy(ApplicationId, applicationId, sizeof(ApplicationId)); StringCopy(ApplicationId, applicationId, sizeof(ApplicationId));
if (handlers) { if (handlers) {
@ -25,14 +25,14 @@ void Discord_Initialize(const char* applicationId, DiscordEventHandlers* handler
MyConnection->Open(); MyConnection->Open();
} }
void Discord_Shutdown() extern "C" void Discord_Shutdown()
{ {
Handlers = {}; Handlers = {};
MyConnection->Close(); MyConnection->Close();
RpcConnection::Destroy(MyConnection); RpcConnection::Destroy(MyConnection);
} }
void Discord_UpdatePresence(const DiscordRichPresence* presence) extern "C" void Discord_UpdatePresence(const DiscordRichPresence* presence)
{ {
auto frame = MyConnection->GetNextFrame(); auto frame = MyConnection->GetNextFrame();
char* jsonWrite = frame->message; char* jsonWrite = frame->message;
@ -41,7 +41,7 @@ void Discord_UpdatePresence(const DiscordRichPresence* presence)
MyConnection->WriteFrame(frame); MyConnection->WriteFrame(frame);
} }
void Discord_Update() extern "C" void Discord_Update()
{ {
// check for messages // check for messages
// todo // todo