Skip to content

Commit

Permalink
src: fix NODE_DEPRECATED macro
Browse files Browse the repository at this point in the history
The NODE_DEPRECATED macro was piggybacking on the V8_DEPRECATED macro
but that macro is silent unless V8_DEPRECATION_WARNINGS is defined,
something io.js doesn't do.  Ergo, no deprecation notices were being
issued.

PR-URL: #1565
Reviewed-By: Trevor Norris <[email protected]>
  • Loading branch information
bnoordhuis committed Apr 29, 2015
1 parent d5ce47e commit 609fa0d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,16 @@
#include "v8.h" // NOLINT(build/include_order)
#include "node_version.h" // NODE_MODULE_VERSION

#define NODE_DEPRECATED(msg, fn) V8_DEPRECATED(msg, fn)
#if defined(__GNUC__)
# define NODE_DEPRECATED(message, declarator) \
__attribute__((deprecated(message))) declarator
#elif defined(_MSC_VER)
# define NODE_DEPRECATED(message, declarator) \
__declspec(deprecated) declarator
#else
# define NODE_DEPRECATED(message, declarator) \
declarator
#endif

// Forward-declare libuv loop
struct uv_loop_s;
Expand Down

0 comments on commit 609fa0d

Please sign in to comment.