diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2015-04-29 20:57:41 +0300 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2015-04-30 02:05:08 +0300 |
commit | 609fa0de039f4285c402ac3f646fcd5d4828d3aa (patch) | |
tree | dcd4ee66af359514e48ad7b9bd945498ab5e15cb /src | |
parent | d5ce47e433c24e9773373ccede613df9f051e7b1 (diff) |
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 <trev.norris@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/node.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/node.h b/src/node.h index 28b40aa0721..5962c32d5b4 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; |