plugify 1.2.8
Loading...
Searching...
No Matches
load_flag.hpp
1#pragma once
2
3#include <cstdint>
4#include <filesystem>
5#include <memory>
6#include <type_traits>
7#include <vector>
8
9namespace plugify {
14 enum class LoadFlag : uint32_t {
15 None = 0,
16 LazyBinding = 1 << 0, // Delay symbol resolution
17 GlobalSymbols = 1 << 1, // Make symbols globally available
18 NoUnload = 1 << 2, // Prevent unloading
19 DeepBind = 1 << 3, // Prefer local symbols (Linux)
20 DataOnly = 1 << 4, // Load as data file (Windows)
21 SecureSearch = 1 << 5, // Use secure search paths (Windows)
22
23 Default = LazyBinding
24 };
25
32 inline LoadFlag operator|(LoadFlag lhs, LoadFlag rhs) noexcept {
33 using underlying = std::underlying_type_t<LoadFlag>;
34 return static_cast<LoadFlag>(static_cast<underlying>(lhs) | static_cast<underlying>(rhs));
35 }
36
43 inline bool operator&(LoadFlag lhs, LoadFlag rhs) noexcept {
44 using underlying = std::underlying_type_t<LoadFlag>;
45 return static_cast<underlying>(lhs) & static_cast<underlying>(rhs);
46 }
47
54 inline LoadFlag& operator|=(LoadFlag& lhs, LoadFlag rhs) noexcept {
55 lhs = lhs | rhs;
56 return lhs;
57 }
58}