From 609fa0de039f4285c402ac3f646fcd5d4828d3aa Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 29 Apr 2015 19:57:41 +0200 Subject: [PATCH] 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: https://github.com/iojs/io.js/pull/1565 Reviewed-By: Trevor Norris --- src/node.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/node.h b/src/node.h index 28b40aa0721b3a..5962c32d5b46ab 100644 --- a/src/node.h +++ b/src/node.h @@ -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;