diff --git a/Makefile b/Makefile index eed6e209..ab2df36c 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ NODRAWINGDISTANCE ?= 0 # Disable texture fixes by default (helps with them purists) TEXTURE_FIX ?= 0 # Enable Discord Rich Presence -DISCORDRPC ?= 0 +DISCORDRPC ?= 1 # Various workarounds for weird toolchains NO_BZERO_BCOPY ?= 0 NO_LDIV ?= 0 diff --git a/src/pc/discord/discordrpc.cpp b/src/pc/discord/discordrpc.cpp index 9b85dfa8..c4546247 100644 --- a/src/pc/discord/discordrpc.cpp +++ b/src/pc/discord/discordrpc.cpp @@ -22,8 +22,8 @@ # define DISCORDLIBEXT ".dll" # define dlopen(lib, flag) LoadLibrary(TEXT(lib)) # define dlerror() "" -# define dlsym(handle, func) (void *)GetProcAddress(handle, func) -# define dlclose(handle) FreeLibrary(handle) +# define dlsym(handle, func) (void *)GetProcAddress(reinterpret_cast(handle), func); +# define dlclose(handle) FreeLibrary(reinterpret_cast(handle)) #elif defined(__APPLE__) # include # define DISCORDLIBEXT ".dylib" @@ -241,11 +241,17 @@ void discord_init(void) { return; } + #if defined(_WIN32) discordInit = (Discord_Initialize) dlsym(handle, "Discord_Initialize"); discordShutdown = (Discord_Shutdown) dlsym(handle, "Discord_Shutdown"); discordClearPresence = (Discord_ClearPresence) dlsym(handle, "Discord_ClearPresence"); discordUpdatePresence = (Discord_UpdatePresence) dlsym(handle, "Discord_UpdatePresence"); - + #else + discordInit = (Discord_Initialize) dlsym(handle, "Discord_Initialize"); + discordShutdown = (Discord_Shutdown) dlsym(handle, "Discord_Shutdown"); + discordClearPresence = (Discord_ClearPresence) dlsym(handle, "Discord_ClearPresence"); + discordUpdatePresence = (Discord_UpdatePresence) dlsym(handle, "Discord_UpdatePresence"); + #endif init_discord(); discordRichPresence.details = stage;