@@ -186,18 +186,18 @@ std::string CodeTree::wrapper_classsname(const std::string& classname) const{
186186
187187std::ostream&
188188CodeTree::generate_version_check_cxx (std::ostream& o) const {
189- auto [jllmin, jllmax ] = version_libcxxwrap_bounds (cxxwrap_version_);
189+ auto [sjllmin, sjllmax ] = version_libcxxwrap_static_bounds (cxxwrap_version_);
190190
191191 indent (o,0 ) << " //method from libcxxwrap returning its version\n " ;
192192 indent (o,0 ) << " extern \" C\" JLCXX_API const char* cxxwrap_version_string();\n\n " ;
193193 indent (o, 0 ) << " //Check the code is compiled with a compatible version of libcxxwrap:\n " ;
194194 indent (o,0 ) << " static_assert(1000*1000*JLCXX_VERSION_MAJOR "
195- " + 1000 * JLCXX_VERSION_MINOR + JLCXX_VERSION_PATCH >= " << jllmin << " \n " ;
195+ " + 1000 * JLCXX_VERSION_MINOR + JLCXX_VERSION_PATCH >= " << sjllmin << " \n " ;
196196 indent (o, 1 ) << " && 1000 * 1000 * JLCXX_VERSION_MAJOR "
197- " + 1000 * JLCXX_VERSION_MINOR + JLCXX_VERSION_PATCH < " << jllmax << " ,\n " ;
197+ " + 1000 * JLCXX_VERSION_MINOR + JLCXX_VERSION_PATCH < " << sjllmax << " ,\n " ;
198198 indent (o,1 ) << " \" The code was generated with WrapIt! for \"\n " ;
199199 indent (o,1 ) << " \" a different CxxWrap version (controlled with the cxxwrap_version parameter).\" );\n\n " ;
200- indent (o, 0 ) << " //Check the version of loaded libcxxwrap library:\n " ;
200+ indent (o, 0 ) << " //Check the version of loaded libcxxrap library:\n " ;
201201 indent (o,0 ) << " void throw_if_version_incompatibility(){\n " ;
202202 indent (o,1 ) << " std::string version_str = cxxwrap_version_string();\n " ;
203203 indent (o,1 ) << " static std::regex r(\" ([[:digit:]]{1,3})\\\\ .([[:digit:]]{1,3})\\\\ .([[:digit:]]{1,3})\" );\n " ;
@@ -208,13 +208,15 @@ CodeTree::generate_version_check_cxx(std::ostream& o) const{
208208 indent (o,2 ) << " long version_int = 1000*1000*strtol(matches[1].str().c_str(), 0, 10)\n " ;
209209 indent (o,2 ) << " + 1000*strtol(matches[2].str().c_str(), 0, 10)\n " ;
210210 indent (o,2 ) << " + strtol(matches[3].str().c_str(), 0, 10);\n " ;
211- indent (o,2 ) << " if(version_int < " << jllmin << " || version_int >= " << jllmax << " ){\n " ;
211+ indent (o,2 ) << " long jllmin = 1000*1000*JLCXX_VERSION_MAJOR + 1000 * JLCXX_VERSION_MINOR;\n " ;
212+ indent (o,2 ) << " long jllmax = 1000*1000*JLCXX_VERSION_MAJOR + 1000 * (JLCXX_VERSION_MINOR + 1);\n " ;
213+ indent (o,2 ) << " if(version_int < jllmin || version_int >= jllmax){\n " ;
212214 indent (o,3 ) << " throw std::runtime_error(std::string(\" Found libcxxwrap_jll version \" )\n " ;
213- indent (o,3 ) << " + version_str + \" , while module " << module_name_ << " requires a version in \"\n " ;
214- indent (o,3 ) << " \" [ " << version_int_to_string (jllmin) << " , " << version_int_to_string (jllmax) << " ) .\"\n " ;
215- indent (o,3 ) << " \" Note: if the module was installed with the package manager, the Project.toml file \"\n " ;
216- indent (o,3 ) << " \" of the package is probably missing a compat specification that would have prevented \"\n " ;
217- indent (o,3 ) << " \" the inconsistency.\" );\n " ;
215+ indent (o,4 ) << " + version_str + \" , while module " << module_name_ << " requires version \"\n " ;
216+ indent (o,4 ) << " + std::to_string(JLCXX_VERSION_MAJOR) + \" . \" + std::to_string(JLCXX_VERSION_MINOR) + \" .x .\"\n " ;
217+ indent (o,4 ) << " \" Note: if the module was installed with the package manager, the Project.toml file \"\n " ;
218+ indent (o,4 ) << " \" of the package is probably missing a compat specification that would have prevented \"\n " ;
219+ indent (o,4 ) << " \" the inconsistency.\" );\n " ;
218220 indent (o,2 ) << " }\n " ;
219221 indent (o,1 ) << " }\n " ;
220222 indent (o,0 ) << " }\n " ;
@@ -3052,6 +3054,11 @@ CodeTree::gen_apply_stl(std::ostream& o, int indent_depth,
30523054 const TypeRcd& type_rcd,
30533055 const std::string& add_type_param) const {
30543056
3057+ if (cxxwrap_version_ >= cxxwrap_v0_17){
3058+ // apply_stl not relevant for CxxWrap 0.17+
3059+ return o;
3060+ }
3061+
30553062 if (type_rcd.stl ){
30563063 indent (o, indent_depth) << " jlcxx::stl::apply_stl<" << add_type_param
30573064 << " >(jlModule);\n " ;
0 commit comments