Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Apply --no-deprecation to C++ warnings as well
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Jun 21, 2012
1 parent 5b39929 commit 48c3d20
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/ev-emul.h
Expand Up @@ -88,7 +88,7 @@ extern "C" {

#define __uv_warn_of(old_, new_) \
do { \
if (__uv_warn_##old_) break; \
if (__uv_warn_##old_ || no_deprecation) break; \
__uv_warn_##old_ = 1; \
fputs("WARNING: " #old_ " is deprecated, use " #new_ "\n", stderr); \
} \
Expand Down
4 changes: 3 additions & 1 deletion src/node.cc
Expand Up @@ -120,7 +120,6 @@ static Persistent<String> disposed_symbol;

static bool print_eval = false;
static bool force_repl = false;
static bool no_deprecation = false;
static bool trace_deprecation = false;
static char *eval_string = NULL;
static int option_end_index = 0;
Expand All @@ -129,6 +128,9 @@ static bool debug_wait_connect = false;
static int debug_port=5858;
static int max_stack_size = 0;

// used by C++ modules as well
bool no_deprecation = false;

static uv_check_t check_tick_watcher;
static uv_prepare_t prepare_tick_watcher;
static uv_idle_t tick_spinner;
Expand Down
2 changes: 2 additions & 0 deletions src/node_internals.h
Expand Up @@ -28,6 +28,8 @@

namespace node {

extern bool no_deprecation;

This comment has been minimized.

Copy link
@bnoordhuis

bnoordhuis Jun 21, 2012

Member

This should live in node.h


#ifdef _WIN32
// emulate snprintf() on windows, _snprintf() doesn't zero-terminate the buffer
// on overflow...
Expand Down
6 changes: 4 additions & 2 deletions src/node_io_watcher.cc
Expand Up @@ -80,12 +80,14 @@ void IOWatcher::Callback(EV_P_ ev_io *w, int revents) {
// io.start();
//
Handle<Value> IOWatcher::New(const Arguments& args) {
fprintf(stderr, "WARNING: don't use IOWatcher, it'll be removed in v0.9\n");

if (!args.IsConstructCall()) {
return FromConstructorTemplate(constructor_template, args);
}

if (!no_deprecation) {
fprintf(stderr, "WARNING: don't use IOWatcher, it'll be removed in v0.9\n");
}

HandleScope scope;
IOWatcher *s = new IOWatcher();
s->Wrap(args.This());
Expand Down

0 comments on commit 48c3d20

Please sign in to comment.