Add a missing header file and correct win32 build error
This commit is contained in:
parent
0683b25259
commit
41b62bc937
5 changed files with 66 additions and 11 deletions
54
include/library/loadlib.hpp
Normal file
54
include/library/loadlib.hpp
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
#ifndef _library__loadlib__hpp__included__
|
||||||
|
#define _library__loadlib__hpp__included__
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <stdexcept>
|
||||||
|
|
||||||
|
#if defined(_WIN32) || defined(_WIN64)
|
||||||
|
#include <windows.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A loaded library.
|
||||||
|
*/
|
||||||
|
class loaded_library
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Load a new library.
|
||||||
|
*
|
||||||
|
* Parameter filename: The name of file.
|
||||||
|
* Throws std::bad_alloc: Not enough memory.
|
||||||
|
* Throws std::runtime_error: Error loading shared library.
|
||||||
|
*/
|
||||||
|
loaded_library(const std::string& filename) throw(std::bad_alloc, std::runtime_error);
|
||||||
|
/**
|
||||||
|
* Unload a library.
|
||||||
|
*/
|
||||||
|
~loaded_library() throw();
|
||||||
|
/**
|
||||||
|
* Look up a symbol.
|
||||||
|
*
|
||||||
|
* Parameter symbol: The symbol to look up.
|
||||||
|
* Returns: The symbol value.
|
||||||
|
* Throws std::bad_alloc: Not enough memory.
|
||||||
|
* Throws std::runtime_error: Error looking up the symbol.
|
||||||
|
*/
|
||||||
|
void* operator[](const std::string& symbol) throw(std::bad_alloc, std::runtime_error);
|
||||||
|
/**
|
||||||
|
* See what libraries are called on this platform.
|
||||||
|
*
|
||||||
|
* Returns: The name of library.
|
||||||
|
*/
|
||||||
|
static const std::string& call_library() throw();
|
||||||
|
private:
|
||||||
|
loaded_library(const loaded_library&);
|
||||||
|
loaded_library& operator=(const loaded_library&);
|
||||||
|
#if defined(_WIN32) || defined(_WIN64)
|
||||||
|
HMODULE handle;
|
||||||
|
#elif !defined(NO_DLFCN)
|
||||||
|
void* handle;
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
#include <wx/string.h>
|
#include <wx/string.h>
|
||||||
#include <wx/wx.h>
|
#include <wx/wx.h>
|
||||||
|
#include <map>
|
||||||
|
|
||||||
class dumper_menu_monitor;
|
class dumper_menu_monitor;
|
||||||
class dumper_info;
|
class dumper_info;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#include "library/loadlib.hpp"
|
#include "library/loadlib.hpp"
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
#if !defined(NO_DLFCN) && !defined(_WIN32) && !defined(_WIN64)
|
#if !defined(NO_DLFCN) && !defined(_WIN32) && !defined(_WIN64)
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
|
@ -76,7 +77,7 @@ void* loaded_library::operator[](const std::string& symbol) throw(std::bad_alloc
|
||||||
throw std::runtime_error(e);
|
throw std::runtime_error(e);
|
||||||
return NULL; //Yes, real NULL symbol.
|
return NULL; //Yes, real NULL symbol.
|
||||||
#elif defined(_WIN32) || defined(_WIN64)
|
#elif defined(_WIN32) || defined(_WIN64)
|
||||||
void* s = GetProcAddress(handle, symbol.c_str());
|
void* s = (void*)GetProcAddress(handle, symbol.c_str());
|
||||||
if(s)
|
if(s)
|
||||||
return s;
|
return s;
|
||||||
int errcode = GetLastError();
|
int errcode = GetLastError();
|
||||||
|
|
|
@ -1,7 +1,13 @@
|
||||||
#include "lsnes.hpp"
|
#include "lsnes.hpp"
|
||||||
|
|
||||||
#include "core/emucore.hpp"
|
#include <wx/dnd.h>
|
||||||
|
#include "platform/wxwidgets/menu_dump.hpp"
|
||||||
|
#include "platform/wxwidgets/platform.hpp"
|
||||||
|
#include "platform/wxwidgets/window_mainwindow.hpp"
|
||||||
|
#include "platform/wxwidgets/window_messages.hpp"
|
||||||
|
#include "platform/wxwidgets/window_status.hpp"
|
||||||
|
|
||||||
|
#include "core/emucore.hpp"
|
||||||
#include "core/audioapi.hpp"
|
#include "core/audioapi.hpp"
|
||||||
#include "core/command.hpp"
|
#include "core/command.hpp"
|
||||||
#include "core/controller.hpp"
|
#include "core/controller.hpp"
|
||||||
|
@ -21,17 +27,10 @@
|
||||||
#include "library/string.hpp"
|
#include "library/string.hpp"
|
||||||
#include "library/zip.hpp"
|
#include "library/zip.hpp"
|
||||||
|
|
||||||
#include <wx/dnd.h>
|
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "platform/wxwidgets/menu_dump.hpp"
|
|
||||||
#include "platform/wxwidgets/platform.hpp"
|
|
||||||
#include "platform/wxwidgets/window_mainwindow.hpp"
|
|
||||||
#include "platform/wxwidgets/window_messages.hpp"
|
|
||||||
#include "platform/wxwidgets/window_status.hpp"
|
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#include "core/window.hpp"
|
|
||||||
|
|
||||||
#include "platform/wxwidgets/window_messages.hpp"
|
#include "platform/wxwidgets/window_messages.hpp"
|
||||||
#include "platform/wxwidgets/platform.hpp"
|
#include "platform/wxwidgets/platform.hpp"
|
||||||
|
|
||||||
|
#include "core/window.hpp"
|
||||||
|
|
||||||
#define MAXMESSAGES 20
|
#define MAXMESSAGES 20
|
||||||
|
|
||||||
wxwin_messages::panel::panel(wxwin_messages* _parent, unsigned lines)
|
wxwin_messages::panel::panel(wxwin_messages* _parent, unsigned lines)
|
||||||
|
|
Loading…
Add table
Reference in a new issue