Random code cleanup
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Core/Win32/DynLibImpl.hpp>
|
||||
#include <Nazara/Core/DynLib.hpp>
|
||||
#include <Nazara/Core/Error.hpp>
|
||||
#include <Nazara/Core/StringExt.hpp>
|
||||
#include <memory>
|
||||
@@ -11,11 +10,6 @@
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
DynLibImpl::DynLibImpl(DynLib*) :
|
||||
m_handle(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
DynLibImpl::~DynLibImpl()
|
||||
{
|
||||
if (m_handle)
|
||||
@@ -24,7 +18,7 @@ namespace Nz
|
||||
|
||||
DynLibFunc DynLibImpl::GetSymbol(const char* symbol, std::string* errorMessage) const
|
||||
{
|
||||
DynLibFunc sym = reinterpret_cast<DynLibFunc>(GetProcAddress(m_handle, symbol));
|
||||
DynLibFunc sym = reinterpret_cast<DynLibFunc>(::GetProcAddress(m_handle, symbol));
|
||||
if (!sym)
|
||||
*errorMessage = Error::GetLastSystemError();
|
||||
|
||||
|
||||
@@ -9,27 +9,28 @@
|
||||
|
||||
#include <NazaraUtils/Prerequisites.hpp>
|
||||
#include <Nazara/Core/DynLib.hpp>
|
||||
#include <NazaraUtils/MovablePtr.hpp>
|
||||
#include <filesystem>
|
||||
#include <windows.h>
|
||||
#include <Windows.h>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
class DynLibImpl
|
||||
{
|
||||
public:
|
||||
DynLibImpl(DynLib* m_parent);
|
||||
DynLibImpl() = default;
|
||||
DynLibImpl(const DynLibImpl&) = delete;
|
||||
DynLibImpl(DynLibImpl&&) = delete; ///TODO?
|
||||
DynLibImpl(DynLibImpl&&) noexcept = default;
|
||||
~DynLibImpl();
|
||||
|
||||
DynLibFunc GetSymbol(const char* symbol, std::string* errorMessage) const;
|
||||
bool Load(const std::filesystem::path& libraryPath, std::string* errorMessage);
|
||||
|
||||
DynLibImpl& operator=(const DynLibImpl&) = delete;
|
||||
DynLibImpl& operator=(DynLibImpl&&) = delete; ///TODO?
|
||||
DynLibImpl& operator=(DynLibImpl&&) noexcept = default;
|
||||
|
||||
private:
|
||||
HMODULE m_handle;
|
||||
MovablePtr<std::remove_pointer_t<HMODULE>> m_handle;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user