src: skip warnings for our own deprecated APIs

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 <tniessen@tnie.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Anna Henningsen 2018-09-02 20:21:21 +02:00 committed by Daniel Bevenius
parent 089c0d1025
commit b4f5cdc6c4

View File

@ -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