Skip to content

Commit

Permalink
feat: add define SAFETYHOOK_USE_CXXMODULES
Browse files Browse the repository at this point in the history
  • Loading branch information
netadr committed Feb 25, 2024
1 parent 91fbc79 commit 195f179
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/safetyhook/allocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@

#pragma once

#ifndef SAFETYHOOK_USE_CXXMODULES
#include <cstdint>
#include <expected>
#include <memory>
#include <mutex>
#include <vector>
#elif
import std.compat;
#endif

namespace safetyhook {
class Allocator;
Expand Down
4 changes: 4 additions & 0 deletions include/safetyhook/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@

#pragma once

#ifndef SAFETYHOOK_USE_CXXMODULES
#include <cstdint>
#elif
import std.compat;
#endif

#include "safetyhook/common.hpp"

Expand Down
4 changes: 4 additions & 0 deletions include/safetyhook/inline_hook.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@

#pragma once

#ifndef SAFETYHOOK_USE_CXXMODULES
#include <cstdint>
#include <expected>
#include <memory>
#include <mutex>
#include <utility>
#include <vector>
#elif
import std.compat;
#endif

#include "safetyhook/allocator.hpp"
#include "safetyhook/common.hpp"
Expand Down
4 changes: 4 additions & 0 deletions include/safetyhook/mid_hook.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@

#pragma once

#ifndef SAFETYHOOK_USE_CXXMODULES
#include <cstdint>
#include <memory>
#elif
import std.compat;
#endif

#include "safetyhook/allocator.hpp"
#include "safetyhook/context.hpp"
Expand Down
4 changes: 4 additions & 0 deletions include/safetyhook/os.hpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
// This is the OS abstraction layer.
#pragma once

#ifndef SAFETYHOOK_USE_CXXMODULES
#include <cstdint>
#include <expected>
#include <functional>
#elif
import std.compat;
#endif

namespace safetyhook {

Expand Down
4 changes: 4 additions & 0 deletions include/safetyhook/utility.hpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#pragma once

#ifndef SAFETYHOOK_USE_CXXMODULES
#include <algorithm>
#include <cstdint>
#include <optional>
#include <type_traits>
#elif
import std.compat;
#endif

namespace safetyhook {
template <typename T> constexpr void store(uint8_t* address, const T& value) {
Expand Down
4 changes: 4 additions & 0 deletions include/safetyhook/vmt_hook.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@

#pragma once

#ifndef SAFETYHOOK_USE_CXXMODULES
#include <cstdint>
#include <expected>
#include <unordered_map>
#elif
import std.compat;
#endif

#include "safetyhook/allocator.hpp"
#include "safetyhook/common.hpp"
Expand Down

0 comments on commit 195f179

Please sign in to comment.