1
0
mirror of synced 2024-11-12 02:00:52 +01:00

sys: More compile time improvements

This commit is contained in:
WerWolv 2021-08-29 22:15:18 +02:00
parent 1ba185bf71
commit 633fa7213a
53 changed files with 258 additions and 217 deletions

View File

@ -46,8 +46,8 @@
#include <stdio.h> // sprintf, scanf
#include <stdint.h> // uint8_t, etc.
#include <hex/helpers/utils.hpp>
#include <hex.hpp>
#include <hex/api/event.hpp>
#include <string>
@ -231,7 +231,7 @@ struct MemoryEditor
if (ImGui::Begin(title, p_open, ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoNavInputs))
{
if (DataPreviewAddr != DataPreviewAddrOld || DataPreviewAddrEnd != DataPreviewAddrEndOld) {
hex::Region selectionRegion = { std::min(DataPreviewAddr, DataPreviewAddrEnd) + base_display_addr, std::max(DataPreviewAddr, DataPreviewAddrEnd) - std::min(DataPreviewAddr, DataPreviewAddrEnd) };
Region selectionRegion = { std::min(DataPreviewAddr, DataPreviewAddrEnd) + base_display_addr, std::max(DataPreviewAddr, DataPreviewAddrEnd) - std::min(DataPreviewAddr, DataPreviewAddrEnd) };
hex::EventManager::post<hex::EventRegionSelected>(selectionRegion);
}

View File

@ -4,7 +4,7 @@
#include <hex/views/view.hpp>
#include <hex/providers/provider.hpp>
#include <hex/helpers/utils.hpp>
#include <hex/helpers/fmt.hpp>
#include <string_view>
#include <dlfcn.h>

View File

@ -5,8 +5,6 @@
#include <vector>
#include <list>
#include <hex/helpers/utils.hpp>
namespace hex {
namespace prv { class Provider; }

View File

@ -1,6 +1,5 @@
#pragma once
#include <hex/helpers/utils.hpp>
#include <hex/views/view.hpp>
#include "helpers/encoding_file.hpp"

View File

@ -5,11 +5,8 @@
#include <string>
#include <vector>
#include <hex/helpers/utils.hpp>
#include <hex/views/view.hpp>
#include <imgui_imhex_extensions.h>
struct GLFWwindow;
struct ImGuiSettingsHandler;

View File

@ -1,5 +1,8 @@
#include <hex/api/content_registry.hpp>
#include <hex/helpers/utils.hpp>
#include <hex/helpers/fmt.hpp>
#include "math_evaluator.hpp"
namespace hex::plugin::builtin {

View File

@ -1,6 +1,7 @@
#include <hex/api/content_registry.hpp>
#include <hex/helpers/utils.hpp>
#include <hex/helpers/fmt.hpp>
#include <cstring>
#include <ctime>

View File

@ -3,6 +3,7 @@
#include <hex/helpers/crypto.hpp>
#include <hex/helpers/shared_data.hpp>
#include <hex/helpers/utils.hpp>
#include <cctype>

View File

@ -1,11 +1,12 @@
#include <hex/api/content_registry.hpp>
#include <hex/helpers/shared_data.hpp>
#include <hex/helpers/fmt.hpp>
#include <hex/lang/ast_node.hpp>
#include <hex/lang/log_console.hpp>
#include <hex/lang/evaluator.hpp>
#include <hex/helpers/utils.hpp>
#include <vector>
namespace hex::plugin::builtin {

View File

@ -2,6 +2,8 @@
#include <hex/helpers/net.hpp>
#include <hex/helpers/shared_data.hpp>
#include <hex/helpers/utils.hpp>
#include <hex/helpers/fmt.hpp>
#include <regex>
#include <chrono>
@ -78,7 +80,7 @@ namespace hex::plugin::builtin {
ImGui::Text("0x%02x", i + 32 * tablePart);
ImGui::TableNextColumn();
ImGui::Text("%s", makePrintable(i + 32 * tablePart).c_str());
ImGui::Text("%s", hex::makePrintable(i + 32 * tablePart).c_str());
ImGui::TableSetBgColor(ImGuiTableBgTarget_RowBg0, ((rowCount % 2) == 0) ? 0xFF101010 : 0xFF303030);

View File

@ -1,6 +1,9 @@
#include <hex/api/content_registry.hpp>
#include <hex/helpers/shared_data.hpp>
#include <hex/helpers/utils.hpp>
#include <hex/helpers/fmt.hpp>
#include <codicons_font.h>
#include <imgui.h>
#include <imgui_internal.h>

View File

@ -1,10 +1,8 @@
#pragma once
#include <cstdint>
#include <cstddef>
#include <hex/helpers/lang.hpp>
#include <hex/helpers/logger.hpp>
using namespace hex::lang_literals;
constexpr static const auto ImHexApiURL = "https://api.werwolv.net/imhex";
@ -22,6 +20,11 @@ using s32 = std::int32_t;
using s64 = std::int64_t;
using s128 = __int128_t;
struct Region {
u64 address;
size_t size;
};
#ifdef OS_WINDOWS
#define MAGIC_PATH_SEPARATOR ";"
#else

View File

@ -1,8 +1,7 @@
#pragma once
#include <hex.hpp>
#include <hex/helpers/utils.hpp>
#include <hex/helpers/concepts.hpp>
#include <functional>
#include <map>

View File

@ -1,9 +1,9 @@
#pragma once
#include <hex.hpp>
#include <hex/helpers/utils.hpp>
#include <list>
#include <vector>
namespace hex {

View File

@ -2,6 +2,7 @@
#include <hex.hpp>
#include <string_view>
#include <vector>
namespace hex::dp {

View File

@ -2,7 +2,6 @@
#include <hex.hpp>
#include <hex/data_processor/attribute.hpp>
#include <hex/helpers/utils.hpp>
#include <set>
#include <string_view>

View File

@ -0,0 +1,148 @@
#pragma once
#include <type_traits>
namespace hex {
template<typename>
struct is_integral_helper : public std::false_type { };
template<>
struct is_integral_helper<u8> : public std::true_type { };
template<>
struct is_integral_helper<s8> : public std::true_type { };
template<>
struct is_integral_helper<u16> : public std::true_type { };
template<>
struct is_integral_helper<s16> : public std::true_type { };
template<>
struct is_integral_helper<u32> : public std::true_type { };
template<>
struct is_integral_helper<s32> : public std::true_type { };
template<>
struct is_integral_helper<u64> : public std::true_type { };
template<>
struct is_integral_helper<s64> : public std::true_type { };
template<>
struct is_integral_helper<u128> : public std::true_type { };
template<>
struct is_integral_helper<s128> : public std::true_type { };
template<>
struct is_integral_helper<bool> : public std::true_type { };
template<>
struct is_integral_helper<char> : public std::true_type { };
template<>
struct is_integral_helper<char8_t> : public std::true_type { };
template<>
struct is_integral_helper<char16_t> : public std::true_type { };
template<>
struct is_integral_helper<char32_t> : public std::true_type { };
template<>
struct is_integral_helper<wchar_t> : public std::true_type { };
template<typename T>
struct is_integral : public is_integral_helper<std::remove_cvref_t<T>>::type { };
template<typename>
struct is_signed_helper : public std::false_type { };
template<>
struct is_signed_helper<s8> : public std::true_type { };
template<>
struct is_signed_helper<s16> : public std::true_type { };
template<>
struct is_signed_helper<s32> : public std::true_type { };
template<>
struct is_signed_helper<s64> : public std::true_type { };
template<>
struct is_signed_helper<s128> : public std::true_type { };
template<>
struct is_signed_helper<char> : public std::true_type { };
template<>
struct is_signed_helper<float> : public std::true_type { };
template<>
struct is_signed_helper<double> : public std::true_type { };
template<>
struct is_signed_helper<long double> : public std::true_type { };
template<typename T>
struct is_signed : public is_signed_helper<std::remove_cvref_t<T>>::type { };
template<typename>
struct is_floating_point_helper : public std::false_type { };
template<>
struct is_floating_point_helper<float> : public std::true_type { };
template<>
struct is_floating_point_helper<double> : public std::true_type { };
template<>
struct is_floating_point_helper<long double> : public std::true_type { };
template<typename T>
struct is_floating_point : public is_floating_point_helper<std::remove_cvref_t<T>>::type { };
}
#if defined(_LIBCPP_VERSION) && _LIBCPP_VERSION <= 12000
#if __has_include(<concepts>)
// Make sure we break when derived_from is implemented in libc++. Then we can fix a compatibility version above
#include <concepts>
#endif
// libcxx 12 still doesn't have many default concepts implemented, as a result we need to define it ourself using clang built-ins.
// [concept.derived] (patch from https://reviews.llvm.org/D74292)
namespace hex {
template<class _Dp, class _Bp>
concept derived_from =
__is_base_of(_Bp, _Dp) && __is_convertible_to(const volatile _Dp*, const volatile _Bp*);
}
#else
// Assume supported
#include <concepts>
namespace hex {
using std::derived_from;
}
#endif
// [concepts.arithmetic]
namespace hex {
template<class T>
concept integral = hex::is_integral<T>::value;
template<class T>
concept signed_integral = integral<T> && hex::is_signed<T>::value;
template<class T>
concept unsigned_integral = integral<T> && !signed_integral<T>;
template<class T>
concept floating_point = std::is_floating_point<T>::value;
}
template<typename T>
struct always_false : std::false_type {};

View File

@ -0,0 +1,19 @@
#pragma once
#include <string_view>
#include <fmt/format.h>
#include <fmt/chrono.h>
namespace hex {
template<typename ... Args>
inline std::string format(std::string_view format, Args ... args) {
return fmt::format(fmt::runtime(format), args...);
}
template<typename ... Args>
inline void print(std::string_view format, Args ... args) {
fmt::print(fmt::runtime(format), args...);
}
}

View File

@ -1,6 +1,8 @@
#pragma once
#include <hex.hpp>
#include <cstring>
#include <future>
#include <string>
#include <filesystem>

View File

@ -2,6 +2,8 @@
#include <hex.hpp>
#include <hex/helpers/concepts.hpp>
#include <array>
#include <cstring>
#include <functional>
@ -11,166 +13,15 @@
#include <type_traits>
#include <vector>
#include <fmt/format.h>
#include <fmt/chrono.h>
#ifdef __MINGW32__
#include <winsock2.h>
#else
#include <arpa/inet.h>
#endif
#include <nfd.hpp>
#if defined(__APPLE__) || defined(__FreeBSD__)
#if defined(OS_MACOS)
#define off64_t off_t
#define fopen64 fopen
#define fseeko64 fseek
#define ftello64 ftell
#endif
namespace hex {
template<typename>
struct is_integral_helper : public std::false_type { };
template<>
struct is_integral_helper<u8> : public std::true_type { };
template<>
struct is_integral_helper<s8> : public std::true_type { };
template<>
struct is_integral_helper<u16> : public std::true_type { };
template<>
struct is_integral_helper<s16> : public std::true_type { };
template<>
struct is_integral_helper<u32> : public std::true_type { };
template<>
struct is_integral_helper<s32> : public std::true_type { };
template<>
struct is_integral_helper<u64> : public std::true_type { };
template<>
struct is_integral_helper<s64> : public std::true_type { };
template<>
struct is_integral_helper<u128> : public std::true_type { };
template<>
struct is_integral_helper<s128> : public std::true_type { };
template<>
struct is_integral_helper<bool> : public std::true_type { };
template<>
struct is_integral_helper<char> : public std::true_type { };
template<>
struct is_integral_helper<char8_t> : public std::true_type { };
template<>
struct is_integral_helper<char16_t> : public std::true_type { };
template<>
struct is_integral_helper<char32_t> : public std::true_type { };
template<>
struct is_integral_helper<wchar_t> : public std::true_type { };
template<typename T>
struct is_integral : public is_integral_helper<std::remove_cvref_t<T>>::type { };
template<typename>
struct is_signed_helper : public std::false_type { };
template<>
struct is_signed_helper<s8> : public std::true_type { };
template<>
struct is_signed_helper<s16> : public std::true_type { };
template<>
struct is_signed_helper<s32> : public std::true_type { };
template<>
struct is_signed_helper<s64> : public std::true_type { };
template<>
struct is_signed_helper<s128> : public std::true_type { };
template<>
struct is_signed_helper<char> : public std::true_type { };
template<>
struct is_signed_helper<float> : public std::true_type { };
template<>
struct is_signed_helper<double> : public std::true_type { };
template<>
struct is_signed_helper<long double> : public std::true_type { };
template<typename T>
struct is_signed : public is_signed_helper<std::remove_cvref_t<T>>::type { };
template<typename>
struct is_floating_point_helper : public std::false_type { };
template<>
struct is_floating_point_helper<float> : public std::true_type { };
template<>
struct is_floating_point_helper<double> : public std::true_type { };
template<>
struct is_floating_point_helper<long double> : public std::true_type { };
template<typename T>
struct is_floating_point : public is_floating_point_helper<std::remove_cvref_t<T>>::type { };
}
#if defined(_LIBCPP_VERSION) && _LIBCPP_VERSION <= 12000
#if __has_include(<concepts>)
// Make sure we break when derived_from is implemented in libc++. Then we can fix a compatibility version above
#include <concepts>
#endif
// libcxx 12 still doesn't have many default concepts implemented, as a result we need to define it ourself using clang built-ins.
// [concept.derived] (patch from https://reviews.llvm.org/D74292)
namespace hex {
template<class _Dp, class _Bp>
concept derived_from =
__is_base_of(_Bp, _Dp) && __is_convertible_to(const volatile _Dp*, const volatile _Bp*);
}
#else
// Assume supported
#include <concepts>
namespace hex {
using std::derived_from;
}
#endif
// [concepts.arithmetic]
namespace hex {
template<class _Tp>
concept integral = hex::is_integral<_Tp>::value;
template<class _Tp>
concept signed_integral = integral<_Tp> && hex::is_signed<_Tp>::value;
template<class _Tp>
concept unsigned_integral = integral<_Tp> && !signed_integral<_Tp>;
template<class _Tp>
concept floating_point = std::is_floating_point<_Tp>::value;
}
#define TOKEN_CONCAT_IMPL(x, y) x ## y
#define TOKEN_CONCAT(x, y) TOKEN_CONCAT_IMPL(x, y)
#define ANONYMOUS_VARIABLE(prefix) TOKEN_CONCAT(prefix, __COUNTER__)
@ -186,16 +37,6 @@ namespace hex {
void runCommand(const std::string &command);
void openWebpage(std::string url);
template<typename ... Args>
inline std::string format(std::string_view format, Args ... args) {
return fmt::format(fmt::runtime(format), args...);
}
template<typename ... Args>
inline void print(std::string_view format, Args ... args) {
fmt::print(fmt::runtime(format), args...);
}
[[nodiscard]] constexpr inline u64 extract(u8 from, u8 to, const hex::unsigned_integral auto &value) {
using ValueType = std::remove_cvref_t<decltype(value)>;
ValueType mask = (std::numeric_limits<ValueType>::max() >> (((sizeof(value) * 8) - 1) - (from - to))) << to;
@ -203,9 +44,6 @@ namespace hex {
return (value & mask) >> to;
}
template<typename T>
struct always_false : std::false_type {};
template<class... Ts> struct overloaded : Ts... { using Ts::operator()...; };
template<class... Ts> overloaded(Ts...) -> overloaded<Ts...>;
@ -416,9 +254,4 @@ namespace hex {
}
struct Region {
u64 address;
size_t size;
};
}

View File

@ -2,20 +2,21 @@
#include <hex.hpp>
#include <hex/providers/provider.hpp>
#include <hex/helpers/utils.hpp>
#include <hex/lang/pattern_data.hpp>
#include <hex/api/content_registry.hpp>
#include <hex/lang/ast_node.hpp>
#include <hex/lang/log_console.hpp>
#include <bit>
#include <span>
#include <string>
#include <unordered_map>
#include <map>
#include <vector>
namespace hex::prv { class Provider; }
namespace hex::lang {
class PatternData;
class Evaluator {
public:
Evaluator() = default;

View File

@ -1,12 +1,11 @@
#pragma once
#include <hex.hpp>
#include <hex/helpers/utils.hpp>
#include "token.hpp"
#include "ast_node.hpp"
#include <hex/helpers/utils.hpp>
#include <unordered_map>
#include <stdexcept>
#include <utility>

View File

@ -5,9 +5,10 @@
#include <imgui.h>
#include <hex/providers/provider.hpp>
#include <hex/helpers/utils.hpp>
#include <hex/lang/token.hpp>
#include <hex/views/view.hpp>
#include <hex/helpers/utils.hpp>
#include <hex/helpers/fmt.hpp>
#include <cstring>
#include <codecvt>

View File

@ -8,7 +8,6 @@
#include <string_view>
#include <vector>
#include <hex/lang/pattern_data.hpp>
#include <hex/lang/log_console.hpp>
namespace hex::prv { class Provider; }
@ -20,6 +19,7 @@ namespace hex::lang {
class Parser;
class Validator;
class Evaluator;
class PatternData;
class PatternLanguage {
public:

View File

@ -2,8 +2,6 @@
#include <hex.hpp>
#include <hex/helpers/utils.hpp>
#include <utility>
#include <string>
#include <variant>

View File

@ -1,6 +1,7 @@
#include <hex/api/content_registry.hpp>
#include <hex/helpers/shared_data.hpp>
#include <hex/helpers/utils.hpp>
#include <filesystem>
#include <fstream>

View File

@ -2,6 +2,8 @@
#include <hex/helpers/shared_data.hpp>
#include <hex/helpers/fmt.hpp>
namespace hex::dp {
Node::Node(std::string_view unlocalizedTitle, std::vector<Attribute> attributes) : m_id(SharedData::dataProcessorNodeIdCounter++), m_unlocalizedTitle(unlocalizedTitle), m_attributes(std::move(attributes)) {

View File

@ -5,6 +5,8 @@
#include <locale>
#include <filesystem>
#include <hex/helpers/fmt.hpp>
#if defined(OS_WINDOWS)
#include <windows.h>
#include <shlobj.h>

View File

@ -1,8 +1,10 @@
#include <hex/lang/evaluator.hpp>
#include <hex/lang/token.hpp>
#include <hex/helpers/utils.hpp>
#include <hex/api/content_registry.hpp>
#include <hex/providers/provider.hpp>
#include <hex/lang/token.hpp>
#include <hex/lang/pattern_data.hpp>
#include <bit>
#include <algorithm>

View File

@ -1,5 +1,7 @@
#include <hex/lang/parser.hpp>
#include <hex/helpers/fmt.hpp>
#include <optional>
#define MATCHES(x) (begin() && x)

View File

@ -1,5 +1,8 @@
#include <hex/lang/preprocessor.hpp>
#include <hex/helpers/utils.hpp>
#include <hex/helpers/fmt.hpp>
#include <filesystem>
namespace hex::lang {

View File

@ -1,10 +1,10 @@
#include <hex/lang/validator.hpp>
#include <hex/helpers/fmt.hpp>
#include <unordered_set>
#include <string>
#include <hex/helpers/utils.hpp>
namespace hex::lang {
Validator::Validator() {

View File

@ -3,6 +3,7 @@
#include <hex.hpp>
#include <cmath>
#include <cstring>
#include <map>
#include <optional>
#include <string>

View File

@ -1,5 +1,8 @@
#include <hex/api/content_registry.hpp>
#include <hex/helpers/utils.hpp>
#include <hex/helpers/fmt.hpp>
#include <windows.h>
#include <psapi.h>

View File

@ -3,6 +3,8 @@
#include <imgui_imhex_extensions.h>
#include <imgui_internal.h>
#include <hex/helpers/utils.hpp>
namespace hex::plugin::windows {
ViewTTYConsole::ViewTTYConsole() : View("hex.windows.view.tty_console.name") {

View File

@ -1,7 +1,7 @@
#include "helpers/loader_script_handler.hpp"
#include <hex/views/view.hpp>
#include <hex/helpers/utils.hpp>
#include <hex/views/view.hpp>
#include <hex/providers/provider.hpp>
#define PY_SSIZE_T_CLEAN

View File

@ -1,11 +1,11 @@
#include "helpers/patches.hpp"
#include <hex/helpers/utils.hpp>
#include <cstring>
#include <string_view>
#include <type_traits>
#include <hex/helpers/utils.hpp>
namespace hex {
static void pushBytesBack(std::vector<u8> &buffer, const char* bytes) {

View File

@ -1,5 +1,7 @@
#include "helpers/plugin_manager.hpp"
#include <hex/helpers/logger.hpp>
#include <filesystem>
namespace hex {
@ -17,7 +19,7 @@ namespace hex {
this->m_handle = dlopen(path.data(), RTLD_LAZY);
if (this->m_handle == nullptr) {
hex::log::error("dlopen failed: {}", dlerror());
log::error("dlopen failed: {}", dlerror());
return;
}

View File

@ -1,6 +1,8 @@
#include "init/splash_window.hpp"
#include <hex/helpers/utils.hpp>
#include <hex/helpers/fmt.hpp>
#include <hex/helpers/logger.hpp>
#include <hex/helpers/shared_data.hpp>
#include <hex/resources.hpp>
@ -145,8 +147,7 @@ namespace hex::init {
void WindowSplash::initGLFW() {
glfwSetErrorCallback([](int error, const char *description) {
log::fatal("GLFW Error: {0} - {0}", error, description);
exit(EXIT_FAILURE);
log::error("GLFW Error [{}] : {}", error, desc);
});
if (!glfwInit()) {

View File

@ -1,7 +1,6 @@
#include "init/tasks.hpp"
#include <hex/helpers/net.hpp>
#include <hex/helpers/utils.hpp>
#include <hex/api/content_registry.hpp>
#include "views/view_hexeditor.hpp"

View File

@ -1,5 +1,8 @@
#include <hex.hpp>
#include <hex/helpers/utils.hpp>
#include <hex/helpers/logger.hpp>
#include "window.hpp"
#include "init/splash_window.hpp"

View File

@ -3,6 +3,7 @@
#include <time.h>
#include <cstring>
#include <hex/helpers/utils.hpp>
#include "helpers/project_file_handler.hpp"
#if defined(OS_WINDOWS)

View File

@ -1,6 +1,8 @@
#include "views/view_bookmarks.hpp"
#include <hex/providers/provider.hpp>
#include <hex/helpers/fmt.hpp>
#include "helpers/project_file_handler.hpp"
#include <cstring>

View File

@ -1,5 +1,8 @@
#include "views/view_constants.hpp"
#include <hex/helpers/utils.hpp>
#include <hex/helpers/logger.hpp>
#include <fstream>
#include <filesystem>
#include <nlohmann/json.hpp>

View File

@ -1,7 +1,7 @@
#include "views/view_disassembler.hpp"
#include <hex/providers/provider.hpp>
#include <hex/helpers/utils.hpp>
#include <hex/helpers/fmt.hpp>
#include <cstring>
#include <thread>

View File

@ -1,7 +1,6 @@
#include "views/view_hashes.hpp"
#include <hex/providers/provider.hpp>
#include <hex/helpers/utils.hpp>
#include <hex/helpers/crypto.hpp>
#include <vector>

View File

@ -2,6 +2,7 @@
#include <hex/providers/provider.hpp>
#include <hex/helpers/utils.hpp>
#include <hex/helpers/fmt.hpp>
#include <cstring>
#include <cmath>

View File

@ -2,7 +2,6 @@
#include <hex/providers/provider.hpp>
#include <hex/helpers/utils.hpp>
#include "helpers/project_file_handler.hpp"
#include <string>

View File

@ -1,8 +1,9 @@
#include "views/view_pattern_editor.hpp"
#include "helpers/project_file_handler.hpp"
#include <hex/helpers/utils.hpp>
#include <hex/lang/preprocessor.hpp>
#include <hex/lang/pattern_data.hpp>
#include <hex/helpers/utils.hpp>
#include <magic.h>

View File

@ -1,7 +1,6 @@
#include "views/view_strings.hpp"
#include <hex/providers/provider.hpp>
#include <hex/helpers/utils.hpp>
#include <cstring>
#include <thread>

View File

@ -1,6 +1,7 @@
#include "views/view_yara.hpp"
#include <hex/providers/provider.hpp>
#include <hex/helpers/utils.hpp>
#include <yara.h>
#include <filesystem>

View File

@ -1,7 +1,10 @@
#include "window.hpp"
#if defined(OS_WINDOWS)
#include <hex/helpers/utils.hpp>
#include <imgui.h>
#include <imgui_internal.h>
#include <codicons_font.h>

View File

@ -1,14 +1,15 @@
#include "window.hpp"
#include <hex.hpp>
#include <hex/api/content_registry.hpp>
#include <hex/resources.hpp>
#include <hex/helpers/utils.hpp>
#include <hex/helpers/logger.hpp>
#include <chrono>
#include <csignal>
#include <iostream>
#include <numeric>
#include <typeinfo>
#include <thread>
#include <imgui.h>