From f4a2ac7288259c0ee13aea60c4c11ab01df1587a Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sun, 2 Sep 2018 20:21:21 +0200 Subject: [PATCH] src: skip warnings for our own deprecated APIs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes the compiler not emit deprecation warnings for places where we use (or, in the case of non-functions, implement) our own deprecated public C++ APIs. PR-URL: https://github.com/nodejs/node/pull/22666 Reviewed-By: Tobias Nießen Reviewed-By: Michaël Zasso Reviewed-By: Refael Ackermann Reviewed-By: James M Snell --- src/node.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/node.h b/src/node.h index fd99b9e4eaa358..be0135125f6a30 100644 --- a/src/node.h +++ b/src/node.h @@ -83,15 +83,18 @@ # define NODE_GNUC_AT_LEAST(major, minor, patch) (0) #endif -#if NODE_CLANG_AT_LEAST(2, 9, 0) || NODE_GNUC_AT_LEAST(4, 5, 0) -# define NODE_DEPRECATED(message, declarator) \ +#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) \ +# elif defined(_MSC_VER) +# define NODE_DEPRECATED(message, declarator) \ __declspec(deprecated) declarator -#else -# define NODE_DEPRECATED(message, declarator) \ - declarator +# else +# define NODE_DEPRECATED(message, declarator) declarator +# endif #endif // Forward-declare libuv loop