Fix issues with integer parsing on MSVC

See #212
This commit is contained in:
Jason Turner
2015-10-04 14:32:23 -06:00
parent 14b3870efb
commit 1add4c4b0f

View File

@@ -17,9 +17,19 @@
#include <cstring> #include <cstring>
#include "../dispatchkit/boxed_value.hpp" #include "../dispatchkit/boxed_value.hpp"
#include "chaiscript_common.hpp" #include "chaiscript_common.hpp"
#if defined(CHAISCRIPT_MSVC) && defined(max) && defined(min)
#pragma push_macro("max") // Why Microsoft? why? This is worse than bad
#undef max
#pragma push_macro("min")
#undef min
#endif
namespace chaiscript namespace chaiscript
{ {
/// \brief Classes and functions used during the parsing process. /// \brief Classes and functions used during the parsing process.
@@ -912,6 +922,8 @@ namespace chaiscript
{ {
} }
Char_Parser &operator=(const Char_Parser &) = delete;
~Char_Parser(){ ~Char_Parser(){
if (is_octal) { if (is_octal) {
process_octal(); process_octal();
@@ -2393,5 +2405,12 @@ namespace chaiscript
} }
} }
#ifdef CHAISCRIPT_MSVC
#pragma pop_macro("min")
#pragma pop_macro("max")
#endif
#endif /* CHAISCRIPT_PARSER_HPP_ */ #endif /* CHAISCRIPT_PARSER_HPP_ */