@@ -71,24 +71,20 @@ typedef void* mi_nothrow_t;
71
71
#define MI_INTERPOSE_FUN (oldfun ,newfun ) { (const void*)&newfun, (const void*)&oldfun }
72
72
#define MI_INTERPOSE_MI (fun ) MI_INTERPOSE_FUN(fun,mi_##fun)
73
73
74
- __attribute__((used )) static struct mi_interpose_s _mi_interposes [] __attribute__((section ("__DATA, __interpose" ))) =
74
+ #define MI_INTERPOSE_DECLS (name ) __attribute__((used)) static struct mi_interpose_s name[] __attribute__((section("__DATA, __interpose")))
75
+
76
+ MI_INTERPOSE_DECLS (_mi_interposes ) =
75
77
{
76
78
MI_INTERPOSE_MI (malloc ),
77
79
MI_INTERPOSE_MI (calloc ),
78
80
MI_INTERPOSE_MI (realloc ),
79
81
MI_INTERPOSE_MI (strdup ),
80
- #if defined(MAC_OS_X_VERSION_10_7 ) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
81
- MI_INTERPOSE_MI (strndup ),
82
- #endif
83
82
MI_INTERPOSE_MI (realpath ),
84
83
MI_INTERPOSE_MI (posix_memalign ),
85
84
MI_INTERPOSE_MI (reallocf ),
86
85
MI_INTERPOSE_MI (valloc ),
87
86
MI_INTERPOSE_FUN (malloc_size ,mi_malloc_size_checked ),
88
87
MI_INTERPOSE_MI (malloc_good_size ),
89
- #if defined(MAC_OS_X_VERSION_10_15 ) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_15
90
- MI_INTERPOSE_MI (aligned_alloc ),
91
- #endif
92
88
#ifdef MI_OSX_ZONE
93
89
// we interpose malloc_default_zone in alloc-override-osx.c so we can use mi_free safely
94
90
MI_INTERPOSE_MI (free ),
@@ -99,6 +95,12 @@ typedef void* mi_nothrow_t;
99
95
MI_INTERPOSE_FUN (vfree ,mi_cfree ),
100
96
#endif
101
97
};
98
+ MI_INTERPOSE_DECLS (_mi_interposes_10_7 ) __OSX_AVAILABLE (10.7 ) = {
99
+ MI_INTERPOSE_MI (strndup ),
100
+ };
101
+ MI_INTERPOSE_DECLS (_mi_interposes_10_15 ) __OSX_AVAILABLE (10.15 ) = {
102
+ MI_INTERPOSE_MI (aligned_alloc ),
103
+ };
102
104
103
105
#ifdef __cplusplus
104
106
extern "C" {
0 commit comments