Skip to content

Commit 1206ea8

Browse files
committed
🛠 things should be properly labeled extern, which should work...
1 parent 9d91f98 commit 1206ea8

2 files changed

Lines changed: 24 additions & 16 deletions

File tree

‎include/ztd/blocks/block.h‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ ZTD_USE(ZTD_EXTERN_C_OPEN)
4646
* This must be paired with Block_release to recover memory, even when running
4747
* under Objective-C Garbage Collection.
4848
*/
49-
ZTD_USE(ZTD_BLOCKS_API_LINKAGE) ZTD_USE(ZTD_EXTERN_C) void* _Block_copy(const void* aBlock) ZTD_USE(ZTD_ATTR_WEAK_FUNC);
49+
ZTD_USE(ZTD_BLOCKS_API_LINKAGE)
50+
ZTD_USE(ZTD_C_LANGUAGE_LINKAGE) void* _Block_copy(const void* aBlock) ZTD_USE(ZTD_ATTR_WEAK_FUNC);
5051

5152
/* Lose the reference, and if heap based and last reference, recover the memory. */
5253
ZTD_USE(ZTD_BLOCKS_API_LINKAGE)
53-
ZTD_USE(ZTD_EXTERN_C) void _Block_release(const void* aBlock) ZTD_USE(ZTD_ATTR_WEAK_FUNC);
54+
ZTD_USE(ZTD_C_LANGUAGE_LINKAGE) void _Block_release(const void* aBlock) ZTD_USE(ZTD_ATTR_WEAK_FUNC);
5455

5556
ZTD_USE(ZTD_EXTERN_C_CLOSE)
5657

‎source/include/ztd/blocks/block_private.h‎

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -99,64 +99,71 @@ enum {
9999

100100
/* Runtime entry point called by compiler when assigning objects inside copy helper routines */
101101
ZTD_USE(ZTD_BLOCKS_API_LINKAGE)
102-
ZTD_USE(ZTD_EXTERN_C)
102+
ZTD_USE(ZTD_C_LANGUAGE_LINKAGE)
103103
ZTD_USE(ZTD_ATTR_WEAK_FUNC)
104104
void _Block_object_assign(void* destAddr, const void* object, const int flags);
105105
/* BLOCK_FIELD_IS_BYREF is only used from within block copy helpers */
106106

107107

108108
/* runtime entry point called by the compiler when disposing of objects inside dispose helper routine */
109109
ZTD_USE(ZTD_BLOCKS_API_LINKAGE)
110-
ZTD_USE(ZTD_EXTERN_C) ZTD_USE(ZTD_ATTR_WEAK_FUNC) void _Block_object_dispose(const void* object, const int flags);
110+
ZTD_USE(ZTD_C_LANGUAGE_LINKAGE)
111+
ZTD_USE(ZTD_ATTR_WEAK_FUNC) void _Block_object_dispose(const void* object, const int flags);
111112

112113

113114

114115
/* Other support functions */
115116

116117
/* Runtime entry to get total size of a closure */
117118
ZTD_USE(ZTD_BLOCKS_API_LINKAGE)
118-
ZTD_USE(ZTD_EXTERN_C) ZTD_USE(ZTD_ATTR_WEAK_FUNC) unsigned long int Block_size(void* block_basic);
119+
ZTD_USE(ZTD_C_LANGUAGE_LINKAGE) ZTD_USE(ZTD_ATTR_WEAK_FUNC) unsigned long int Block_size(void* block_basic);
119120

120121

121122

122123
/* the raw data space for runtime classes for blocks */
123124
/* class+meta used for stack, malloc, and collectable based blocks */
124-
ZTD_USE(ZTD_BLOCKS_API_LINKAGE) ZTD_USE(ZTD_EXTERN_C) ZTD_USE(ZTD_ATTR_WEAK_VAR) void* _NSConcreteStackBlock[32];
125-
ZTD_USE(ZTD_BLOCKS_API_LINKAGE) ZTD_USE(ZTD_EXTERN_C) ZTD_USE(ZTD_ATTR_WEAK_VAR) void* _NSConcreteMallocBlock[32];
126-
ZTD_USE(ZTD_BLOCKS_API_LINKAGE) ZTD_USE(ZTD_EXTERN_C) ZTD_USE(ZTD_ATTR_WEAK_VAR) void* _NSConcreteAutoBlock[32];
127-
ZTD_USE(ZTD_BLOCKS_API_LINKAGE) ZTD_USE(ZTD_EXTERN_C) ZTD_USE(ZTD_ATTR_WEAK_VAR) void* _NSConcreteFinalizingBlock[32];
128-
ZTD_USE(ZTD_BLOCKS_API_LINKAGE) ZTD_USE(ZTD_EXTERN_C) ZTD_USE(ZTD_ATTR_WEAK_VAR) void* _NSConcreteGlobalBlock[32];
129-
ZTD_USE(ZTD_BLOCKS_API_LINKAGE) ZTD_USE(ZTD_EXTERN_C) ZTD_USE(ZTD_ATTR_WEAK_VAR) void* _NSConcreteWeakBlockVariable[32];
125+
ZTD_USE(ZTD_BLOCKS_API_LINKAGE)
126+
ZTD_USE(ZTD_C_LANGUAGE_LINKAGE) ZTD_USE(ZTD_ATTR_WEAK_VAR) void* _NSConcreteStackBlock[32];
127+
ZTD_USE(ZTD_BLOCKS_API_LINKAGE)
128+
ZTD_USE(ZTD_C_LANGUAGE_LINKAGE) ZTD_USE(ZTD_ATTR_WEAK_VAR) void* _NSConcreteMallocBlock[32];
129+
ZTD_USE(ZTD_BLOCKS_API_LINKAGE)
130+
ZTD_USE(ZTD_C_LANGUAGE_LINKAGE) ZTD_USE(ZTD_ATTR_WEAK_VAR) void* _NSConcreteAutoBlock[32];
131+
ZTD_USE(ZTD_BLOCKS_API_LINKAGE)
132+
ZTD_USE(ZTD_C_LANGUAGE_LINKAGE) ZTD_USE(ZTD_ATTR_WEAK_VAR) void* _NSConcreteFinalizingBlock[32];
133+
ZTD_USE(ZTD_BLOCKS_API_LINKAGE)
134+
ZTD_USE(ZTD_C_LANGUAGE_LINKAGE) ZTD_USE(ZTD_ATTR_WEAK_VAR) void* _NSConcreteGlobalBlock[32];
135+
ZTD_USE(ZTD_BLOCKS_API_LINKAGE)
136+
ZTD_USE(ZTD_C_LANGUAGE_LINKAGE) ZTD_USE(ZTD_ATTR_WEAK_VAR) void* _NSConcreteWeakBlockVariable[32];
130137

131138

132139
/* the intercept routines that must be used under GC */
133140
ZTD_USE(ZTD_BLOCKS_API_LINKAGE)
134-
ZTD_USE(ZTD_EXTERN_C)
141+
ZTD_USE(ZTD_C_LANGUAGE_LINKAGE)
135142
ZTD_USE(ZTD_ATTR_WEAK_FUNC)
136143
void _Block_use_GC(void* (*alloc)(const unsigned long, const bool isOne, const bool isObject),
137144
void (*setHasRefcount)(const void*, const bool), void (*gc_assign_strong)(void*, void**),
138145
void (*gc_assign_weak)(const void*, void*), void (*gc_memmove)(void*, void*, unsigned long));
139146

140147
/* earlier version, now simply transitional */
141148
ZTD_USE(ZTD_BLOCKS_API_LINKAGE)
142-
ZTD_USE(ZTD_EXTERN_C)
149+
ZTD_USE(ZTD_C_LANGUAGE_LINKAGE)
143150
ZTD_USE(ZTD_ATTR_WEAK_FUNC)
144151
void _Block_use_GC5(void* (*alloc)(const unsigned long, const bool isOne, const bool isObject),
145152
void (*setHasRefcount)(const void*, const bool), void (*gc_assign_strong)(void*, void**),
146153
void (*gc_assign_weak)(const void*, void*));
147154

148155
ZTD_USE(ZTD_BLOCKS_API_LINKAGE)
149-
ZTD_USE(ZTD_EXTERN_C)
156+
ZTD_USE(ZTD_C_LANGUAGE_LINKAGE)
150157
ZTD_USE(ZTD_ATTR_WEAK_FUNC)
151158
void _Block_use_RR(void (*retain)(const void*), void (*release)(const void*));
152159

153160
/* make a collectable GC heap based Block. Not useful under non-GC. */
154161
ZTD_USE(ZTD_BLOCKS_API_LINKAGE)
155-
ZTD_USE(ZTD_EXTERN_C) ZTD_USE(ZTD_ATTR_WEAK_FUNC) void* _Block_copy_collectable(const void* aBlock);
162+
ZTD_USE(ZTD_C_LANGUAGE_LINKAGE) ZTD_USE(ZTD_ATTR_WEAK_FUNC) void* _Block_copy_collectable(const void* aBlock);
156163

157164
/* thread-unsafe diagnostic */
158165
ZTD_USE(ZTD_BLOCKS_API_LINKAGE)
159-
ZTD_USE(ZTD_EXTERN_C) ZTD_USE(ZTD_ATTR_WEAK_FUNC) const char* _Block_dump(const void* block);
166+
ZTD_USE(ZTD_C_LANGUAGE_LINKAGE) ZTD_USE(ZTD_ATTR_WEAK_FUNC) const char* _Block_dump(const void* block);
160167

161168

162169
/* Obsolete */

0 commit comments

Comments
 (0)