MCPcopy Create free account
hub / github.com/VirtualGL/virtualgl / loadOCLSymbol

Function loadOCLSymbol

server/faker-sym.cpp:250–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248#ifdef FAKEOPENCL
249
250static void *loadOCLSymbol(const char *name, bool optional)
251{
252 char *err = NULL;
253
254 if(!ocldllhnd)
255 {
256 if(strlen(fconfig.ocllib) > 0)
257 {
258 dlerror(); // Clear error state
259 void *dllhnd = _vgl_dlopen(fconfig.ocllib, RTLD_LAZY);
260 err = dlerror();
261 if(!dllhnd)
262 {
263 vglout.print("[VGL] ERROR: Could not open %s\n", fconfig.ocllib);
264 if(err) vglout.print("[VGL] %s\n", err);
265 return NULL;
266 }
267 ocldllhnd = dllhnd;
268 }
269 else ocldllhnd = RTLD_NEXT;
270 }
271
272 dlerror(); // Clear error state
273 void *sym = dlsym(ocldllhnd, (char *)name);
274 err = dlerror();
275
276 if(!sym && (fconfig.verbose || !optional))
277 {
278 vglout.print("[VGL] %s: Could not load function \"%s\"",
279 optional ? "WARNING" : "ERROR", name);
280 if(strlen(fconfig.ocllib) > 0)
281 vglout.print(" from %s", fconfig.ocllib);
282 vglout.print("\n");
283 if(err) vglout.print("[VGL] %s\n", err);
284 }
285 return sym;
286}
287
288#endif
289

Callers 1

loadSymbolFunction · 0.85

Calls 2

_vgl_dlopenFunction · 0.85
printMethod · 0.45

Tested by

no test coverage detected