Skip to content

Commit

Permalink
simplecpp.h: push and pop the MSVC warning disabling #pragma so the…
Browse files Browse the repository at this point in the history
…y don't spill into user code
  • Loading branch information
firewave committed Aug 22, 2023
1 parent f5a5679 commit ed25b30
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions simplecpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#endif

#if defined(_MSC_VER)
# pragma warning(push)
// suppress warnings about "conversion from 'type1' to 'type2', possible loss of data"
# pragma warning(disable : 4267)
# pragma warning(disable : 4244)
Expand Down Expand Up @@ -370,6 +371,10 @@ namespace simplecpp {
SIMPLECPP_LIB std::string getCppStdString(const std::string &std);
}

#if defined(_MSC_VER)
# pragma warning(pop)
#endif

#if (__cplusplus < 201103L) && !defined(__APPLE__)
#undef nullptr
#endif
Expand Down

0 comments on commit ed25b30

Please sign in to comment.