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: https://github.com/nodejs/node/pull/63755
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
This commit is contained in:
Anna Henningsen authored and Antoine du Hamel committed 2026-06-18 10:10:45 +02:00
1 parent 30595da67b
commit 6d22d373a9
1 file changed
+1 -9
+1 -9
View File
@@ -111,15 +111,7 @@
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
# define NODE_DEPRECATED(message, declarator) declarator
#else // NODE_WANT_INTERNALS
# if NODE_CLANG_AT_LEAST(2, 9, 0) || NODE_GNUC_AT_LEAST(4, 5, 0)
# define NODE_DEPRECATED(message, declarator) \
__attribute__((deprecated(message))) declarator
# elif defined(_MSC_VER)
# define NODE_DEPRECATED(message, declarator) \
__declspec(deprecated) declarator
# else
# define NODE_DEPRECATED(message, declarator) declarator
# endif
#define NODE_DEPRECATED(message, declarator) [[deprecated(message)]] declarator
#endif
// Forward-declare libuv loop