Skip to content

Commit

Permalink
Silence warnings at nan/node headers
Browse files Browse the repository at this point in the history
  • Loading branch information
mildsunrise committed Feb 14, 2020
1 parent dd107fa commit 241b902
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pcap_binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,6 @@ void Initialize(Local<Object> exports)
Nan::Set(exports, Nan::New("lib_version").ToLocalChecked(), Nan::New<FunctionTemplate>(LibVersion)->GetFunction(Nan::GetCurrentContext()).ToLocalChecked());
}

DISABLE_WCAST_FUNCTION_TYPE
NODE_MODULE(pcap_binding, Initialize)
DISABLE_WCAST_FUNCTION_TYPE_END
10 changes: 10 additions & 0 deletions pcap_session.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
#ifndef PCAP_SESSION_H
#define PCAP_SESSION_H

#if defined(__GNUC__) && __GNUC__ >= 8
#define DISABLE_WCAST_FUNCTION_TYPE _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wcast-function-type\"")
#define DISABLE_WCAST_FUNCTION_TYPE_END _Pragma("GCC diagnostic pop")
#else
#define DISABLE_WCAST_FUNCTION_TYPE
#define DISABLE_WCAST_FUNCTION_TYPE_END
#endif

DISABLE_WCAST_FUNCTION_TYPE
#include <nan.h>
DISABLE_WCAST_FUNCTION_TYPE_END
#include <uv.h>
#include <pcap/pcap.h>

Expand Down

0 comments on commit 241b902

Please sign in to comment.