From af44da916a7f44065c6c31d8bcae3a14bad3620f Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Sat, 22 Feb 2014 16:09:34 -0700 Subject: [PATCH 1/2] Fix warnings and errors on VisualStudio 2013 Interestingly, VS2013 with Boost 1.55 exhibited the issues complained about in issue #92, so I was able to provide an appropriate fix. It would appear to be bugs in both compilers, which seems very odd. --- include/chaiscript/dispatchkit/bootstrap.hpp | 6 ++++- .../dispatchkit/proxy_functions_detail.hpp | 24 +++++++++++++++++++ src/main.cpp | 4 ++-- src/reflection.cpp | 7 +++++- src/test_module.cpp | 6 +++++ 5 files changed, 43 insertions(+), 4 deletions(-) diff --git a/include/chaiscript/dispatchkit/bootstrap.hpp b/include/chaiscript/dispatchkit/bootstrap.hpp index 787b05c1..af2a148b 100644 --- a/include/chaiscript/dispatchkit/bootstrap.hpp +++ b/include/chaiscript/dispatchkit/bootstrap.hpp @@ -279,7 +279,11 @@ namespace chaiscript boost::shared_ptr pf = boost::dynamic_pointer_cast(t_pf); if (pf) { - return pf->get_guard(); + if (pf->get_guard()) { + return true; + } else { + return false; + } } else { return false; } diff --git a/include/chaiscript/dispatchkit/proxy_functions_detail.hpp b/include/chaiscript/dispatchkit/proxy_functions_detail.hpp index eda5173c..dedc44ef 100644 --- a/include/chaiscript/dispatchkit/proxy_functions_detail.hpp +++ b/include/chaiscript/dispatchkit/proxy_functions_detail.hpp @@ -86,13 +86,20 @@ namespace chaiscript * if any unboxing fails the execution of the function fails and * the bad_boxed_cast is passed up to the caller. */ +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable : 4100) +#endif + #ifdef __llvm__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunused-parameter" #endif + template Ret call_func(const boost::function &f, const std::vector ¶ms, const Dynamic_Cast_Conversions & BOOST_PP_IF(n, t_conversions, BOOST_PP_EMPTY)) + #ifdef __llvm__ #pragma clang diagnostic pop #endif @@ -105,19 +112,31 @@ namespace chaiscript } } +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + /** * Used by Proxy_Function_Impl to determine if it is equivalent to another * Proxy_Function_Impl object. This function is primarly used to prevent * registration of two functions with the exact same signatures */ +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable : 4100) +#endif + #ifdef __llvm__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunused-parameter" #endif + template bool compare_types_cast(Ret (*)(BOOST_PP_ENUM_PARAMS(n, Param)), const std::vector & BOOST_PP_IF(n, params, BOOST_PP_EMPTY), const Dynamic_Cast_Conversions &t_conversions) + + #ifdef __llvm__ #pragma clang diagnostic pop #endif @@ -131,6 +150,11 @@ namespace chaiscript return true; } + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + } } } diff --git a/src/main.cpp b/src/main.cpp index 163adbe2..1524931e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -46,7 +46,7 @@ void *cast_module_symbol(std::string (*t_path)()) std::string default_search_path() { -#ifdef CHAISCRIPT_WINDOWS // force no unicode +#ifdef BOOST_WINDOWS // force no unicode CHAR path[4096]; int size = GetModuleFileNameA(0, path, sizeof(path)-1); @@ -60,8 +60,8 @@ std::string default_search_path() return ""; } - #else + std::string exepath; std::vector buf(2048); diff --git a/src/reflection.cpp b/src/reflection.cpp index 289d2533..92713795 100644 --- a/src/reflection.cpp +++ b/src/reflection.cpp @@ -24,7 +24,12 @@ bool has_parse_tree(const chaiscript::Const_Proxy_Function &t_pf) = boost::dynamic_pointer_cast(t_pf); if (pf) { - return pf->get_parse_tree(); + if (pf->get_parse_tree()) + { + return true; + } else { + return false; + } } else { return false; } diff --git a/src/test_module.cpp b/src/test_module.cpp index 417bb37e..796f5ff0 100644 --- a/src/test_module.cpp +++ b/src/test_module.cpp @@ -15,6 +15,9 @@ class TestBaseType int val; const int const_val; + + private: + TestBaseType &operator=(const TestBaseType &); }; enum TestEnum @@ -32,6 +35,9 @@ class TestDerivedType : public TestBaseType public: virtual ~TestDerivedType() {} virtual int func() { return 1; } + + private: + TestDerivedType &operator=(const TestDerivedType &); }; std::string hello_world() From 8c70fff02b4a8a6e76f75b6f8cc0ee65bb7b9c7d Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Sun, 23 Feb 2014 07:10:03 -0700 Subject: [PATCH 2/2] Update version to 4.3.0 --- CMakeLists.txt | 2 +- releasenotes.txt | 30 +++++++++++++++++++++++++----- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ecaa265a..394c1eaa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,7 @@ set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/readme.md") set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/description.txt") set(CPACK_PACKAGE_VERSION_MAJOR 4) -set(CPACK_PACKAGE_VERSION_MINOR 2) +set(CPACK_PACKAGE_VERSION_MINOR 3) set(CPACK_PACKAGE_VERSION_PATCH 0) set(CPACK_PACKAGE_EXECUTABLES "chai;ChaiScript Eval") set(CPACK_PACKAGE_VENDOR "ChaiScript.com") diff --git a/releasenotes.txt b/releasenotes.txt index 96bf8d05..7df1dc7d 100644 --- a/releasenotes.txt +++ b/releasenotes.txt @@ -1,8 +1,29 @@ -Changes since 4.1.1 +Current Version: 4.3.0 + +Note: this is scheduled to be the last release that requires boost, new releases after this will require a C++11 compiler. + +### Changes since 4.2.0 +* Enhanced unit tests +* Add `continue` statement, fix various use cases for `for` loops +* Fix use of suffixed numbers in vector initialization +* Code cleanups +* Eliminate global data, which makes code more portable and thread safe +* Fix issue #79 +* Merge pretty_print fixes from @mgee #82 +* Compiler warning fixes for latest compiler releases +* Fix threading problems +* Fix linking error on MacOS Mavericks #88 +* Allow non-const globals +* Make sure user cannot name a variable with `::` in it #91 +* Fix various string / map / vector `size` and `count` calls for compilers which have weird overloads for them. #90 #93 #95 +* Make module search path relative to the currently running executable +* Build and work with wstring windows builds + +### Changes since 4.1.1 * Add support for automatic conversion of arithmetic types when possible and when no ambiguous method dispatch exists. -Changes since 4.1.0 +### Changes since 4.1.0 * Fix missed gcc build error in 4.1.0 Changes since 4.0.0 @@ -29,7 +50,7 @@ Changes since 3.1.0 * Increased unit tests to 161 * Performance enhancements -Changes since 3.0.0 +### Changes since 3.0.0 * Numeric operations performance increased approximately 10x * Looping operations performance increased up to 2x * Engine start up time decreased @@ -38,8 +59,7 @@ Changes since 3.0.0 uint8_t, uint16_t, uint32_t, uint64_t, int8_t, int16_t, int32_t, int64_t * Enhanced support for capturing of exceptions thrown from ChaiScript in C++ -Changes since 2.3.3 - +### Changes since 2.3.3 * Code simplifications * Fully integrate documentation with source code in doxygen style comments * Unit tests increased from 114 to 137