Skip to content

Commit 679db9a

Browse files
committed
[RemoteMirror] Use __attribute__((deprecated)) instead of [[deprecated]].
Use __attribute__((deprecated)) in SwiftRemoteMirror.h as it needs to be includable from C.
1 parent b01dbc5 commit 679db9a

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

include/swift/SwiftRemoteMirror/Platform.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ extern "C" {
4141
# endif
4242
#endif
4343

44+
#if defined(__clang__)
45+
#define SWIFT_REMOTE_MIRROR_DEPRECATED(MSG, FIX) \
46+
__attribute__((__deprecated__(MSG, FIX)))
47+
#else
48+
#define SWIFT_REMOTE_MIRROR_DEPRECATED(MSG, FIX) [[deprecated(MSG)]]
49+
#endif
50+
4451
#if defined(__cplusplus)
4552
}
4653
#endif

include/swift/SwiftRemoteMirror/SwiftRemoteMirror.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,9 @@ swift_reflection_typeRefForMangledTypeName(SwiftReflectionContextRef ContextRef,
188188
///
189189
/// The returned string is heap allocated and the caller must free() it when
190190
/// done.
191-
[[deprecated("Please use swift_reflection_copyNameForTypeRef()")]]
191+
SWIFT_REMOTE_MIRROR_DEPRECATED(
192+
"Please use swift_reflection_copyNameForTypeRef()",
193+
"swift_reflection_copyNameForTypeRef")
192194
SWIFT_REMOTE_MIRROR_LINKAGE
193195
char *
194196
swift_reflection_copyDemangledNameForTypeRef(

0 commit comments

Comments
 (0)