Skip to content

Commit

Permalink
Windows: Tweak msvc warning suppression
Browse files Browse the repository at this point in the history
  • Loading branch information
kkoopa committed Apr 12, 2015
1 parent 207a62d commit 0833e8b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
8 changes: 0 additions & 8 deletions nan_new.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,19 +202,11 @@ NanNew() {
return NanIntern::Factory<T>::New();
}

#if defined(_MSC_VER)
# pragma warning( push )
# pragma warning( disable : 4800 )
#endif
template <typename T, typename A0>
typename NanIntern::Factory<T>::return_t
NanNew(A0 arg0) {
return NanIntern::Factory<T>::New(arg0);
}
#if defined(_MSC_VER)
# pragma warning( pop )
#endif


template <typename T, typename A0, typename A1>
typename NanIntern::Factory<T>::return_t
Expand Down
8 changes: 8 additions & 0 deletions test/cpp/nannew.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,15 @@ NAN_METHOD(testRegression212) {

typedef int gint;
typedef gint gboolean;
#if defined(_MSC_VER)
# pragma warning( push )
# pragma warning( disable : 4800 )
#endif
t.ok(_( assertType<Boolean>( NanNew<Boolean>(gboolean(23)))));
#if defined(_MSC_VER)
# pragma warning( pop )
#endif

return_NanUndefined();
}

Expand Down
9 changes: 9 additions & 0 deletions test/cpp/news.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,16 @@ NAN_METHOD(NewBoolean) {
// #212
NAN_METHOD(NewBoolean2) {
NanScope();

#if defined(_MSC_VER)
# pragma warning( push )
# pragma warning( disable : 4800 )
#endif
NanReturnValue(NanNew<v8::Boolean>(1));
#if defined(_MSC_VER)
# pragma warning( pop )
#endif

}

void Init(v8::Handle<v8::Object> target) {
Expand Down

0 comments on commit 0833e8b

Please sign in to comment.