File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
Sources/OpenGraphCxx/DebugServer Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 22// interpose.c
33// OpenGraphCxx
44
5+ #include <OpenGraph/OGBase.h>
56#include "stdio.h"
67#include "stdbool.h"
78#include "string.h"
89
9- #define DYLD_INTERPOSE (_replacement ,_replacee ) \
10- __attribute__((used)) static struct{ const void* replacement; const void* replacee; } _interpose_##_replacee \
11- __attribute__ ((section ("__DATA,__interpose"))) = { (const void*)(unsigned long)&_replacement, (const void*)(unsigned long)&_replacee };
12-
10+ #if OG_TARGET_OS_DARWIN
1311extern bool os_variant_has_internal_diagnostics (const char * subsystem );
12+ #endif
1413
1514bool og_variant_has_internal_diagnostics (const char * subsystem ) {
1615 if (strcmp (subsystem , "org.OpenSwiftUIProject.OpenGraph" ) == 0 ) {
1716 return true;
1817 } else if (strcmp (subsystem , "com.apple.AttributeGraph" ) == 0 ) {
1918 return true;
2019 } else {
20+ #if OG_TARGET_OS_DARWIN
2121 return os_variant_has_internal_diagnostics (subsystem );
22+ #else
23+ return false;
24+ #endif
2225 }
2326}
2427
28+ #if OG_TARGET_OS_DARWIN
29+ #define DYLD_INTERPOSE (_replacement ,_replacee ) \
30+ __attribute__((used)) static struct{ const void* replacement; const void* replacee; } _interpose_##_replacee \
31+ __attribute__ ((section ("__DATA,__interpose"))) = { (const void*)(unsigned long)&_replacement, (const void*)(unsigned long)&_replacee };
32+
2533DYLD_INTERPOSE (og_variant_has_internal_diagnostics , os_variant_has_internal_diagnostics )
34+ #endif
You can’t perform that action at this time.
0 commit comments