Skip to content

Commit 3714165

Browse files
authored
Merge pull request #54 from bobot/mlcuddidl
patches for mlcuddidl for ocaml 5
2 parents 312ea93 + c04cd74 commit 3714165

File tree

2 files changed

+113
-0
lines changed

2 files changed

+113
-0
lines changed
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
commit a584ab0e479f6a63b5a2fdac073ee8cb70fcb730
2+
Author: François Bobot <[email protected]>
3+
Date: Mon Sep 1 16:04:44 2025 +0200
4+
5+
Remove vdd and others which depends too much on the runtime
6+
7+
diff --git a/Makefile b/Makefile
8+
index ecfa494..66e4d9c 100644
9+
--- a/Makefile
10+
+++ b/Makefile
11+
@@ -40,9 +40,9 @@ LDFLAGS = -L$(CAMLIDL_DIR) -lcamlidl
12+
# Files
13+
#---------------------------------------
14+
15+
-IDLMODULES = hash cache memo man bdd vdd custom add
16+
+IDLMODULES = hash cache memo man bdd
17+
18+
-MLMODULES = hash cache memo man bdd vdd custom weakke pWeakke mtbdd mtbddc user mapleaf add
19+
+MLMODULES = hash cache memo man bdd
20+
21+
CUDDAUX_C = $(wildcard cuddaux*.c)
22+
CCMODULES = $(CUDDAUX_C:%.c=%) $(IDLMODULES:%=%_caml) cudd_caml
23+
diff --git a/configure b/configure
24+
index ab42604..5577c32 100755
25+
--- a/configure
26+
+++ b/configure
27+
@@ -114,8 +114,8 @@ find_ocmd OCAMLC ocamlc;
28+
29+
overs=$(${OCAMLC} -version);
30+
case "${overs}" in
31+
- [1-3].* | 4.0[1-3].* | [5-9]* | [1-9][0-9]*)
32+
- err "OCaml version found is ${overs}: OCaml >= 4.04 & < 5 is required.";;
33+
+ [1-3].* | 4.0[1-3].* | [1-9][0-9]*)
34+
+ err "OCaml version found is ${overs}: OCaml >= 4.04.";;
35+
*)
36+
:;;
37+
esac
38+
diff --git a/cudd_caml.c b/cudd_caml.c
39+
index 662b91d..6bb5846 100644
40+
--- a/cudd_caml.c
41+
+++ b/cudd_caml.c
42+
@@ -1080,7 +1080,7 @@ value camlidl_cudd_avdd_iter_cube(value _v_closure, value _v_no)
43+
_v_val = type.value;
44+
}
45+
else {
46+
- _v_val = copy_double(val);
47+
+ _v_val = caml_copy_double(val);
48+
}
49+
caml_callback2(_v_closure,_v_array,_v_val);
50+
}
51+
@@ -1604,8 +1604,8 @@ DdNode* camlidl_cudd_custom_op2(DdManager* dd, struct op2* op,
52+
_v_G = cuddauxCamlV(G);
53+
}
54+
else {
55+
- _v_F = copy_double(cuddV(F));
56+
- _v_G = copy_double(cuddV(G));
57+
+ _v_F = caml_copy_double(cuddV(F));
58+
+ _v_G = caml_copy_double(cuddV(G));
59+
}
60+
_v_val = caml_callback2_exn(op->closure2, _v_F, _v_G);
61+
res = camlidl_cudd_custom_result(&op->common2,_v_val);
62+
@@ -1654,9 +1654,9 @@ DdNode* camlidl_cudd_custom_op3(DdManager* dd, struct op3* op, DdNode* F, DdNode
63+
_v_H = cuddauxCamlV(H);
64+
}
65+
else {
66+
- _v_F = copy_double(cuddV(F));
67+
- _v_G = copy_double(cuddV(G));
68+
- _v_H = copy_double(cuddV(H));
69+
+ _v_F = caml_copy_double(cuddV(F));
70+
+ _v_G = caml_copy_double(cuddV(G));
71+
+ _v_H = caml_copy_double(cuddV(H));
72+
}
73+
_v_val = caml_callback3_exn(op->closure3,_v_F,_v_G,_v_H);
74+
res = camlidl_cudd_custom_result(&op->common3,_v_val);
75+
@@ -1707,8 +1707,8 @@ DdNode* camlidl_cudd_custom_test2(DdManager* dd, struct test2* op, DdNode* F, Dd
76+
_v_G = cuddauxCamlV(G);
77+
}
78+
else {
79+
- _v_F = copy_double(cuddV(F));
80+
- _v_G = copy_double(cuddV(G));
81+
+ _v_F = caml_copy_double(cuddV(F));
82+
+ _v_G = caml_copy_double(cuddV(G));
83+
}
84+
_v_val = caml_callback2_exn(op->closure2t, _v_F, _v_G);
85+
res = camlidl_cudd_custom_resultbool(&op->common2t,_v_val);
86+
diff --git a/cuddaux.h b/cuddaux.h
87+
index 71f9898..4df5615 100644
88+
--- a/cuddaux.h
89+
+++ b/cuddaux.h
90+
@@ -323,7 +323,7 @@ static inline DdNode* cuddauxUniqueType(struct CuddauxMan* man, CuddauxType* typ
91+
}
92+
static inline value Val_type(bool caml, CuddauxType* type)
93+
{
94+
- return caml ? type->value : copy_double(type->dbl);
95+
+ return caml ? type->value : caml_copy_double(type->dbl);
96+
}
97+
static inline value Val_DdNode(bool caml, DdNode* node)
98+
{
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
commit a6135f9b75e3923cbd720e4b02b57073b022f1a7
2+
Author: François Bobot <[email protected]>
3+
Date: Thu Nov 6 10:06:16 2025 +0100
4+
5+
The exn field is a value not a void*
6+
7+
diff --git a/sedscript_c b/sedscript_c
8+
index 5aa3525..48b86a3 100644
9+
--- a/sedscript_c
10+
+++ b/sedscript_c
11+
@@ -13,3 +13,4 @@ s/camlidl_bdd/camlidl_cudd_bdd/g;
12+
s/camlidl_add/camlidl_cudd_add/g;
13+
s/camlidl_zdd/camlidl_cudd_zdd/g;
14+
s/camlidl_vdd/camlidl_cudd_vdd/g;
15+
+s/(\*_c2)\.exn = NULL;/(*_c2).exn = Val_unit;/g;

0 commit comments

Comments
 (0)