build: Add support for unity builds

This commit is contained in:
WerWolv
2023-11-30 10:22:15 +01:00
parent 09904b77eb
commit e370fdb0fc
25 changed files with 77 additions and 79 deletions

View File

@@ -1,15 +1,10 @@
#pragma once
#include <hex/helpers/fs.hpp>
#include <functional>
#include <span>
#include <string>
#if defined(OS_WINDOWS)
#include <windows.h>
#else
#include <dlfcn.h>
#endif
#include <wolv/io/fs.hpp>
struct ImGuiContext;
@@ -65,11 +60,7 @@ namespace hex {
[[nodiscard]] std::span<SubCommand> getSubCommands() const;
private:
#if defined(OS_WINDOWS)
HMODULE m_handle = nullptr;
#else
void *m_handle = nullptr;
#endif
uintptr_t m_handle = 0;
std::fs::path m_path;
mutable bool m_initialized = false;

View File

@@ -65,6 +65,8 @@ namespace hex::dp {
friend class Node;
void setParentNode(Node *node) { this->m_parentNode = node; }
static int s_idCounter;
};
}

View File

@@ -17,6 +17,8 @@ namespace hex::dp {
private:
int m_id;
int m_from, m_to;
static int s_idCounter;
};
}

View File

@@ -87,6 +87,8 @@ namespace hex::dp {
prv::Overlay *m_overlay = nullptr;
ImVec2 m_position;
static int s_idCounter;
Attribute& getAttribute(u32 index) {
if (index >= this->getAttributes().size())
throw std::runtime_error("Attribute index out of bounds!");

View File

@@ -10,14 +10,14 @@
#include <wolv/io/file.hpp>
#include <wolv/utils/guards.hpp>
using curl_off_t = long long;
#if defined(OS_WEB)
#include <emscripten/fetch.h>
using curl_off_t = long;
#else
#include <curl/curl.h>
#endif
typedef void CURL;
namespace hex {
class HttpRequest {