File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -180,6 +180,27 @@ respectively. Their linker-level names will be platform-dependent: refer to the
180
180
linker documentation for your platform to determine what names to place in the
181
181
` __asm__ ` attribute applied to each.
182
182
183
+ If you can't use ` __asm__ ` on your platform, you can declare these symbols as
184
+ C++ references to linker-defined symbols:
185
+
186
+ ``` diff
187
+ diff --git a/Sources/_TestingInternals/Discovery.cpp b/Sources/_TestingInternals/Discovery.cpp
188
+ // ...
189
+ + #elif defined(macintosh)
190
+ + extern "C" const char __linker_defined_begin_symbol;
191
+ + extern "C" const char __linker_defined_end_symbol;
192
+ + static const auto& sectionBegin = __linker_defined_begin_symbol;
193
+ + static const auto& sectionEnd = __linker_defined_end_symbol;
194
+ #else
195
+ #warning Platform-specific implementation missing: Runtime test discovery unavailable (static)
196
+ static const char sectionBegin = 0;
197
+ static const char& sectionEnd = sectionBegin;
198
+ #endif
199
+ ```
200
+
201
+ The names of ` __linker_defined_begin_symbol ` and ` __linker_defined_end_symbol `
202
+ in this example are, as with the shorter implementation, platform-dependent.
203
+
183
204
## C++ stub implementations
184
205
185
206
Some symbols defined in C and C++ headers, especially "complex" macros, cannot
You can’t perform that action at this time.
0 commit comments