Skip to content

Commit

Permalink
src: skip warnings for our own deprecated APIs
Browse files Browse the repository at this point in the history
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: #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>
  • Loading branch information
addaleax authored and danbev committed Sep 5, 2018
1 parent 089c0d1 commit b4f5cdc
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b4f5cdc

Please sign in to comment.