Skip to content

Commit 4826d74

Browse files
authored
src: use C++14 deprecated attribute for NODE_DEPRECATED
This has been standardized for a while, so there's no real reason not to just use it over compiler-specific alternatives. Signed-off-by: Anna Henningsen <anna@addaleax.net> PR-URL: #63755 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
1 parent 45f6b83 commit 4826d74

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

src/node.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,7 @@
111111
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
112112
# define NODE_DEPRECATED(message, declarator) declarator
113113
#else // NODE_WANT_INTERNALS
114-
# if NODE_CLANG_AT_LEAST(2, 9, 0) || NODE_GNUC_AT_LEAST(4, 5, 0)
115-
# define NODE_DEPRECATED(message, declarator) \
116-
__attribute__((deprecated(message))) declarator
117-
# elif defined(_MSC_VER)
118-
# define NODE_DEPRECATED(message, declarator) \
119-
__declspec(deprecated) declarator
120-
# else
121-
# define NODE_DEPRECATED(message, declarator) declarator
122-
# endif
114+
#define NODE_DEPRECATED(message, declarator) [[deprecated(message)]] declarator
123115
#endif
124116

125117
// Forward-declare libuv loop

0 commit comments

Comments
 (0)