Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: skip warnings for our own deprecated APIs #22666

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
  • Loading branch information
addaleax committed Sep 2, 2018
commit afa0d8f4695e57c053102029a7a1779425e35eb7
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