aboutsummaryrefslogtreecommitdiff
path: root/lib/substitute-internal.h
diff options
context:
space:
mode:
authorcomex2015-01-16 04:22:58 -0500
committercomex2015-01-16 04:33:39 -0500
commitd2963f46218c6dc73c6207a1bdcf7042b0af3418 (patch)
tree61e55419011a865ced995bbb2ba67f9998978b4b /lib/substitute-internal.h
parentjump dis - seemingly working(!) (diff)
downloadsubstitute-d2963f46218c6dc73c6207a1bdcf7042b0af3418.tar.gz
interpose (based on %c based on data) compiles...
Diffstat (limited to '')
-rw-r--r--lib/substitute-internal.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/substitute-internal.h b/lib/substitute-internal.h
index cbb7462..fb64714 100644
--- a/lib/substitute-internal.h
+++ b/lib/substitute-internal.h
@@ -1,10 +1,28 @@
#pragma once
#include <stdio.h>
-#define panic(...) do { \
+#define substitute_panic(...) do { \
fprintf(stderr, __VA_ARGS__); \
abort(); \
__builtin_unreachable(); \
} while(0)
#define EXPORT __attribute__ ((visibility("default")))
+#define UNUSED __attribute__((unused))
+
+#ifdef __APPLE__
+#include <mach-o/loader.h>
+#include <mach-o/dyld.h>
+#include <mach-o/dyld_images.h>
+#ifdef __LP64__
+typedef struct mach_header_64 mach_header_x;
+typedef struct segment_command_64 segment_command_x;
+typedef struct section_64 section_x;
+#define LC_SEGMENT_X LC_SEGMENT_64
+#else
+typedef struct mach_header mach_header_x;
+typedef struct segment_command segment_command_x;
+typedef struct section section_x;
+#define LC_SEGMENT_X LC_SEGMENT
+#endif
+#endif