From 6d22d373a99a50c0c7bdfd4e2d7a773a8d4e544c Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sun, 7 Jun 2026 18:06:39 +0200 Subject: [PATCH] src: use C++14 deprecated attribute for `NODE_DEPRECATED` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 PR-URL: https://github.com/nodejs/node/pull/63755 Reviewed-By: Michaƫl Zasso Reviewed-By: Chengzhong Wu --- src/node.h | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/node.h b/src/node.h index e25fe19c9ab..18969ad90a0 100644 --- a/src/node.h +++ b/src/node.h @@ -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