From 21cd133480baaae324add6ad6f1d0f53fc34bfbc Mon Sep 17 00:00:00 2001 From: Lysann Tranvouez Date: Sun, 28 Sep 2025 00:42:23 +0200 Subject: [PATCH] reorganize files and add missing includes --- CMakeLists.txt | 13 +++++++++---- mach_detours.h => include/mach_detours.h | 0 {arm64 => src/arm64}/detours_arm64.h | 2 ++ detours_internal.h => src/detours_internal.h | 2 ++ mach_detours.c => src/mach_detours.c | 0 5 files changed, 13 insertions(+), 4 deletions(-) rename mach_detours.h => include/mach_detours.h (100%) rename {arm64 => src/arm64}/detours_arm64.h (98%) rename detours_internal.h => src/detours_internal.h (91%) rename mach_detours.c => src/mach_detours.c (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index e50253f..379af8f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,8 +4,13 @@ project(mach_detours C) set(CMAKE_C_STANDARD 23) add_library(mach_detours SHARED - mach_detours.c - mach_detours.h - arm64/detours_arm64.h - detours_internal.h + include/mach_detours.h + + src/mach_detours.c + src/detours_internal.h + src/arm64/detours_arm64.h ) + +target_include_directories(mach_detours + PUBLIC "include" + PRIVATE "src") diff --git a/mach_detours.h b/include/mach_detours.h similarity index 100% rename from mach_detours.h rename to include/mach_detours.h diff --git a/arm64/detours_arm64.h b/src/arm64/detours_arm64.h similarity index 98% rename from arm64/detours_arm64.h rename to src/arm64/detours_arm64.h index 9120780..bf73c85 100644 --- a/arm64/detours_arm64.h +++ b/src/arm64/detours_arm64.h @@ -5,6 +5,8 @@ #ifndef MACH_DETOURS_ARM64_H #define MACH_DETOURS_ARM64_H +#include + typedef struct detour_align { uint8_t obTarget; diff --git a/detours_internal.h b/src/detours_internal.h similarity index 91% rename from detours_internal.h rename to src/detours_internal.h index cb03395..e3a734b 100644 --- a/detours_internal.h +++ b/src/detours_internal.h @@ -10,6 +10,8 @@ #define DETOUR_TRACE(x) printf x #define DETOUR_BREAK() raise(SIGTRAP) #else +#include +#include #define DETOUR_TRACE(x) #define DETOUR_BREAK() #endif diff --git a/mach_detours.c b/src/mach_detours.c similarity index 100% rename from mach_detours.c rename to src/mach_detours.c