Skip to content

Commit e5e72e6

Browse files
addaleaxtargos
authored andcommitted
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: #22666 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 43092eb commit e5e72e6

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/node.h

+10-7
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,18 @@
8383
# define NODE_GNUC_AT_LEAST(major, minor, patch) (0)
8484
#endif
8585

86-
#if NODE_CLANG_AT_LEAST(2, 9, 0) || NODE_GNUC_AT_LEAST(4, 5, 0)
87-
# define NODE_DEPRECATED(message, declarator) \
86+
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
87+
# define NODE_DEPRECATED(message, declarator) declarator
88+
#else // NODE_WANT_INTERNALS
89+
# if NODE_CLANG_AT_LEAST(2, 9, 0) || NODE_GNUC_AT_LEAST(4, 5, 0)
90+
# define NODE_DEPRECATED(message, declarator) \
8891
__attribute__((deprecated(message))) declarator
89-
#elif defined(_MSC_VER)
90-
# define NODE_DEPRECATED(message, declarator) \
92+
# elif defined(_MSC_VER)
93+
# define NODE_DEPRECATED(message, declarator) \
9194
__declspec(deprecated) declarator
92-
#else
93-
# define NODE_DEPRECATED(message, declarator) \
94-
declarator
95+
# else
96+
# define NODE_DEPRECATED(message, declarator) declarator
97+
# endif
9598
#endif
9699

97100
// Forward-declare libuv loop

0 commit comments

Comments
 (0)