Skip to content

Commit 609fa0d

Browse files
committed
src: fix NODE_DEPRECATED macro
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]>
1 parent d5ce47e commit 609fa0d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/node.h

+10-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,16 @@
4242
#include "v8.h" // NOLINT(build/include_order)
4343
#include "node_version.h" // NODE_MODULE_VERSION
4444

45-
#define NODE_DEPRECATED(msg, fn) V8_DEPRECATED(msg, fn)
45+
#if defined(__GNUC__)
46+
# define NODE_DEPRECATED(message, declarator) \
47+
__attribute__((deprecated(message))) declarator
48+
#elif defined(_MSC_VER)
49+
# define NODE_DEPRECATED(message, declarator) \
50+
__declspec(deprecated) declarator
51+
#else
52+
# define NODE_DEPRECATED(message, declarator) \
53+
declarator
54+
#endif
4655

4756
// Forward-declare libuv loop
4857
struct uv_loop_s;

0 commit comments

Comments
 (0)