LCOV - code coverage report
Current view: top level - gfx/vr/openvr/src - sharedlibtools_public.cpp (source / functions) Hit Total Coverage
Test: output.info Lines: 0 8 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 3 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //========= Copyright Valve Corporation ============//
       2             : #include "sharedlibtools_public.h"
       3             : #include <string.h>
       4             : 
       5             : #if defined(_WIN32)
       6             : #include <windows.h>
       7             : #endif
       8             : 
       9             : #if defined(POSIX)
      10             : #include <dlfcn.h>
      11             : #endif
      12             : 
      13           0 : SharedLibHandle SharedLib_Load( const char *pchPath )
      14             : {
      15             : #if defined( _WIN32)
      16             :         return (SharedLibHandle)LoadLibraryEx( pchPath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH );
      17             : #elif defined(POSIX)
      18           0 :         return (SharedLibHandle)dlopen(pchPath, RTLD_LOCAL|RTLD_NOW);
      19             : #endif
      20             : }
      21             : 
      22           0 : void *SharedLib_GetFunction( SharedLibHandle lib, const char *pchFunctionName)
      23             : {
      24             : #if defined( _WIN32)
      25             :   return (void*)GetProcAddress( (HMODULE)lib, pchFunctionName );
      26             : #elif defined(POSIX)
      27           0 :         return dlsym( lib, pchFunctionName );
      28             : #endif
      29             : }
      30             : 
      31             : 
      32           0 : void SharedLib_Unload( SharedLibHandle lib )
      33             : {
      34           0 :         if ( !lib )
      35           0 :                 return;
      36             : #if defined( _WIN32)
      37             :         FreeLibrary( (HMODULE)lib );
      38             : #elif defined(POSIX)
      39           0 :         dlclose( lib );
      40             : #endif
      41             : }
      42             : 
      43             : 

Generated by: LCOV version 1.13