diff --git a/CHANGES.current b/CHANGES.current index 09facd90b..9c1e8a2b3 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -7,6 +7,9 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/ Version 4.0.2 (in progress) =========================== +2019-12-29: ZackerySpytz + [OCaml] #1686 Fix compilation errors with OCaml 4.09.0. + 2019-12-10: wsfulton #1679 Fix parsing of C++11 identifiers with special meaning (final and override) when they are used as part of the scope name of an identifier, such as a namespace name. diff --git a/Lib/ocaml/carray.i b/Lib/ocaml/carray.i index 5e74c3da1..4378f7333 100644 --- a/Lib/ocaml/carray.i +++ b/Lib/ocaml/carray.i @@ -77,7 +77,7 @@ type _value = c_obj %typemap(out) SWIGTYPE [] { int i; - CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr"); + const CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr"); $result = caml_array_new($1_dim0); for( i = 0; i < $1_dim0; i++ ) { diff --git a/Lib/ocaml/ocaml.swg b/Lib/ocaml/ocaml.swg index ac496bdba..afb01daea 100644 --- a/Lib/ocaml/ocaml.swg +++ b/Lib/ocaml/ocaml.swg @@ -62,7 +62,7 @@ #if 0 %typemap(argout) SWIGTYPE & { - CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr"); + const CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr"); if( fromval ) { swig_result = caml_list_append(swig_result, @@ -75,7 +75,7 @@ } } %typemap(argout) SWIGTYPE && { - CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr"); + const CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr"); if( fromval ) { swig_result = caml_list_append(swig_result, diff --git a/Lib/ocaml/ocamlrun.swg b/Lib/ocaml/ocamlrun.swg index 3d552cc50..5a923c5fe 100644 --- a/Lib/ocaml/ocamlrun.swg +++ b/Lib/ocaml/ocamlrun.swg @@ -407,7 +407,7 @@ extern "C" { CAMLreturn((long)SWIG_Int64_val(SWIG_Field(SWIG_Field(v,0),0))); case C_enum: { SWIG_CAMLlocal1(ret); - CAML_VALUE *enum_to_int = caml_named_value(SWIG_MODULE "_enum_to_int"); + const CAML_VALUE *enum_to_int = caml_named_value(SWIG_MODULE "_enum_to_int"); if( !name ) caml_failwith( "Not an enum conversion" ); ret = caml_callback2(*enum_to_int,*caml_named_value(name),v); CAMLreturn(caml_long_val(ret)); @@ -451,7 +451,7 @@ extern "C" { CAMLparam1(v); void *outptr = NULL; swig_type_info *outdescr = NULL; - static CAML_VALUE *func_val = NULL; + static const CAML_VALUE *func_val = NULL; if( v == Val_unit ) { *out = 0; @@ -574,7 +574,7 @@ extern "C" { CAMLparam0(); SWIG_CAMLlocal1(result); - CAML_VALUE *fromval = caml_named_value(name); + const CAML_VALUE *fromval = caml_named_value(name); if (fromval) { result = caml_callback(*fromval, caml_val_ptr(ptr, descriptor)); } else { diff --git a/Source/Modules/ocaml.cxx b/Source/Modules/ocaml.cxx index 6f2a34962..9f7504b87 100644 --- a/Source/Modules/ocaml.cxx +++ b/Source/Modules/ocaml.cxx @@ -1619,7 +1619,7 @@ public: /* pass the method call on to the OCaml object */ Printv(w->code, "swig_result = caml_swig_alloc(1,C_list);\n" "SWIG_Store_field(swig_result,0,args);\n" "args = swig_result;\n" "swig_result = Val_unit;\n", 0); - Printf(w->code, "static CAML_VALUE *swig_ocaml_func_val = NULL;\n" "if (!swig_ocaml_func_val) {\n"); + Printf(w->code, "static const CAML_VALUE *swig_ocaml_func_val = NULL;\n" "if (!swig_ocaml_func_val) {\n"); Printf(w->code, " swig_ocaml_func_val = caml_named_value(\"swig_runmethod\");\n }\n"); Printf(w->code, "swig_result = caml_callback3(*swig_ocaml_func_val,swig_get_self(),caml_copy_string(\"%s\"),args);\n", Getattr(n, "name")); /* exception handling */