File scilab-ocaml.patch of Package scilab
--- a/modules/scicos/Makefile.modelica.am
+++ b/modules/scicos/Makefile.modelica.am
@@ -23,7 +23,7 @@ if OCAML
TARGET = modelicac XML2Modelica modelicat
BASE_PATH = $(srcdir)/src/
bin_PROGRAMS = $(TARGET)
-OCAMLLIBS=nums.cma
+OCAMLLIBS=$(shell cd "`ocamlc -where`" ; for i in nums.cma num/num.cma ; do test -f $$i || continue ; f="`readlink -f $$i`" ; echo "-I `dirname $$f`" ; echo "`basename $$i`" ; break ; done)
### XML2Modelica
--- a/modules/scicos/src/modelica_compiler/optimization.ml
+++ b/modules/scicos/src/modelica_compiler/optimization.ml
@@ -20,6 +20,7 @@
*
*)
+open Num
open SymbolicExpression
@@ -162,8 +163,7 @@ let num_of_float f =
let num_of_positive_float f =
let m, e = frexp f in
let sm = string_of_float m in
- let s = String.make 16 '0' in
- String.blit sm 2 s 0 (String.length sm - 2);
+ let s = String.sub sm 2 (String.length sm - 2) in
let e' = Num.power_num (Num.Int 2) (Num.num_of_int e) in
Num.div_num (Num.mult_num (Num.num_of_string s) e') scaling_factor
in
--- a/modules/scicos/src/modelica_compiler/xMLCodeGeneration.ml
+++ b/modules/scicos/src/modelica_compiler/xMLCodeGeneration.ml
@@ -20,6 +20,7 @@
*
*)
+open Num
type 'a tree = Leaf of (string * 'a) | Node of string * 'a tree list
(* function used to hide XML special characters *)