Created
January 4, 2017 14:29
-
-
Save Icenowy/090f9e825c0a8046f1ce16547b81d46c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <dlfcn.h> | |
#define NULL ((void *)0) | |
static void * libmali = NULL; | |
static void *(*maliEglGetProcAddress)(char *) = NULL; | |
void *eglGetProcAddress(char *name) | |
{ | |
void *tmp; | |
if (!libmali) | |
libmali = dlopen("libMali.so", RTLD_LAZY); | |
if (!libmali) | |
return NULL; | |
if (!maliEglGetProcAddress) | |
maliEglGetProcAddress = dlsym(libmali, "eglGetProcAddress"); | |
if (!maliEglGetProcAddress) | |
return NULL; | |
tmp = maliEglGetProcAddress(name); | |
if (tmp) | |
return tmp; | |
else | |
return dlsym(libmali, name); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment