Skip to content

Instantly share code, notes, and snippets.

@buzzySmile
Created March 26, 2014 11:55
Show Gist options
  • Save buzzySmile/9781591 to your computer and use it in GitHub Desktop.
Save buzzySmile/9781591 to your computer and use it in GitHub Desktop.
#if defined(__WIN32__) || defined(_WIN32) || defined(WIN32) || defined(__WINDOWS__) || defined(__TOS_WIN__)
#include <windows.h>
#include <stdint.h>
#define GET_METHOD GetProcAddress
#define OPEN_LIBRARY(X) LoadLibrary((LPCSTR)X)
#define LIBRARY_POINTER_TYPE HMODULE
#define CLOSE_LIBRARY FreeLibrary
#else
#include <dlfcn.h>
#include <unistd.h>
#define GET_METHOD dlsym
#define OPEN_LIBRARY(X) dlopen(X, RTLD_NOW)
#define LIBRARY_POINTER_TYPE void*
#define CLOSE_LIBRARY dlclose
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment