summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Src/DynamicLibrary.cpp
diff options
context:
space:
mode:
authornakeee <nakeee@gmail.com>2009-01-26 16:27:01 +0000
committernakeee <nakeee@gmail.com>2009-01-26 16:27:01 +0000
commit356db07cbfb39e9fb77dbfe750f59bf604da498f (patch)
tree971a818d53e5d6ae9fde72d855df7903fc2ecfa0 /Source/Core/Common/Src/DynamicLibrary.cpp
parentbc6bbafb958df87fd8300f7303cd13dc82f15d5a (diff)
fixed compile,
fixed crash, added panicalert` git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2017 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/Common/Src/DynamicLibrary.cpp')
-rw-r--r--Source/Core/Common/Src/DynamicLibrary.cpp54
1 files changed, 21 insertions, 33 deletions
diff --git a/Source/Core/Common/Src/DynamicLibrary.cpp b/Source/Core/Common/Src/DynamicLibrary.cpp
index 1d18bef1e1..7344461592 100644
--- a/Source/Core/Common/Src/DynamicLibrary.cpp
+++ b/Source/Core/Common/Src/DynamicLibrary.cpp
@@ -15,20 +15,11 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
+/*
+ All plugins from Core > Plugins are loaded and unloaded with this class when
+ Dolpin is started and stopped.
+*/
-//////////////////////////////////////////////////////////////////////////////////////////
-// File description
-/* ŻŻŻŻŻŻŻŻŻŻŻŻ
-
- All plugins from Core > Plugins are loaded and unloaded with this class when Dolpin is started
- and stopped.
-
-//////////////////////////////////////*/
-
-
-//////////////////////////////////////////////////////////////////////////////////////////
-// Include
-// ŻŻŻŻŻŻŻŻŻŻŻŻ
#include <string.h> // System
#ifdef _WIN32
#include <windows.h>
@@ -42,7 +33,6 @@
#include "StringUtil.h"
#include "DynamicLibrary.h"
#include "ConsoleWindow.h"
-////////////////////////////////////////
DynamicLibrary::DynamicLibrary()
@@ -81,26 +71,25 @@ std::string GetLastErrorAsString()
#endif
}
-/* Function: Loading means loading the dll with LoadLibrary() to get an instance to the dll.
- This is done when Dolphin is started to determine which dlls are good, and before opening
- the Config and Debugging windows from Plugin.cpp and before opening the dll for running
- the emulation in Video_...cpp in Core. Since this is fairly slow, TODO: think about
+/* Function: Loading means loading the dll with LoadLibrary() to get an
+ instance to the dll. This is done when Dolphin is started to determine
+ which dlls are good, and before opening the Config and Debugging windows
+ from Plugin.cpp and before opening the dll for running the emulation in
+ Video_...cpp in Core. Since this is fairly slow, TODO: think about
implementing some sort of cache.
Called from: The Dolphin Core */
int DynamicLibrary::Load(const char* filename)
{
- if (!filename || strlen(filename) == 0)
- {
- LOG(MASTER_LOG, "Missing filename of dynamic library to load");
- PanicAlert("Missing filename of dynamic library to load");
- return 0;
+ if (!filename || strlen(filename) == 0) {
+ LOG(MASTER_LOG, "Missing filename of dynamic library to load");
+ PanicAlert("Missing filename of dynamic library to load");
+ return 0;
}
LOG(MASTER_LOG, "Trying to load library %s", filename);
- if (IsLoaded())
- {
- LOG(MASTER_LOG, "Trying to load already loaded library %s", filename);
- return 2;
+ if (IsLoaded()) {
+ LOG(MASTER_LOG, "Trying to load already loaded library %s", filename);
+ return 2;
}
#ifdef _WIN32
@@ -110,11 +99,10 @@ int DynamicLibrary::Load(const char* filename)
library = dlopen(filename, RTLD_NOW | RTLD_LOCAL);
#endif
- if (!library)
- {
- LOG(MASTER_LOG, "Error loading DLL %s: %s", filename, GetLastErrorAsString().c_str());
- PanicAlert("Error loading DLL %s: %s\n", filename, GetLastErrorAsString().c_str());
- return 0;
+ if (!library) {
+ LOG(MASTER_LOG, "Error loading DLL %s: %s", filename, GetLastErrorAsString().c_str());
+ PanicAlert("Error loading DLL %s: %s\n", filename, GetLastErrorAsString().c_str());
+ return 0;
}
library_file = filename;
@@ -162,7 +150,7 @@ void* DynamicLibrary::Get(const char* funcname) const
if (!retval)
{
LOG(MASTER_LOG, "Symbol %s missing in %s (error: %s)\n", funcname, library_file.c_str(), GetLastErrorAsString().c_str());
- //PanicAlert("Symbol %s missing in %s (error: %s)\n", funcname, library_file.c_str(), GetLastErrorAsString().c_str());
+ PanicAlert("Symbol %s missing in %s (error: %s)\n", funcname, library_file.c_str(), GetLastErrorAsString().c_str());
}
return retval;