language-extensions/R/test/src/linux/Utilities_linux.cpp
//-------------------------------------------------------------------------------------------------
// Name: Utilities::CrossPlatCloseLibrary
//
// Description:
//  Given a valid library handle, close it.
//
// Returns:
//  On success, returns nothing. Otherwise, throws a runtime_error exception.
//
:CrossPlatCloseLibrary
Description:
Given a valid library handle, close it.

On success, returns nothing. Otherwise, throws a runtime_error exception.
: CrossPlatCloseLibrary Description : Given a valid library handle close it . On success returns nothing . Otherwise throws a runtime_error exception .
void Utilities::CrossPlatCloseLibrary(void *libHandle)
{
	if (libHandle != nullptr)
	{
		int returnVal = dlclose(libHandle);
		if( returnVal != 0 )
		{
			char *error = dlerror();
			string errorString("CrossPlatCloseLibrary failed with error: " + string(error));
			cout << errorString << endl;
			throw runtime_error(errorString);
		}
	}
}
void Utilities :: CrossPlatCloseLibrary ( void * libHandle ) { if ( libHandle != nullptr ) { int returnVal = dlclose ( libHandle ) ; if ( returnVal != 0 ) { char * error = dlerror ( ) ; string errorString ( " " + string ( error ) ) ; cout << errorString << endl ; throw runtime_error ( errorString ) ; } } }
Name: Utilities::CrossPlatCloseLibrary
Description:
Given a valid library handle, close it.
Name : Utilities :: CrossPlatCloseLibrary Description : Given a valid library handle close it .