Revision 53206908 src/backends/C/c_backend_header.ml
src/backends/C/c_backend_header.ml | ||
---|---|---|
34 | 34 |
struct |
35 | 35 |
|
36 | 36 |
let print_import_standard fmt = |
37 |
fprintf fmt "#include \"%s/arrow.h\"@.@." Version.include_path |
|
37 |
begin |
|
38 |
if !Options.mpfr then |
|
39 |
begin |
|
40 |
fprintf fmt "#include <mpfr.h>@." |
|
41 |
end; |
|
42 |
fprintf fmt "#include \"%s/arrow.h\"@.@." Version.include_path |
|
43 |
end |
|
38 | 44 |
|
39 | 45 |
let rec print_static_val pp_var fmt v = |
40 |
match v with |
|
46 |
match v.value_desc with
|
|
41 | 47 |
| Cst c -> pp_c_const fmt c |
42 | 48 |
| LocalVar v -> pp_var fmt v |
43 | 49 |
| Fun (n, vl) -> Basic_library.pp_c n (print_static_val pp_var) fmt vl |
... | ... | |
144 | 150 |
pp_machine_static_link_name m.mname.node_id |
145 | 151 |
inst |
146 | 152 |
|
153 |
|
|
147 | 154 |
let print_machine_decl fmt m = |
148 | 155 |
Mod.print_machine_decl_prefix fmt m; |
149 | 156 |
if fst (get_stateless_status m) then |
... | ... | |
175 | 182 |
fprintf fmt "extern %a;@.@." |
176 | 183 |
(print_reset_prototype self) (m.mname.node_id, m.mstatic); |
177 | 184 |
|
185 |
fprintf fmt "extern %a;@.@." |
|
186 |
(print_init_prototype self) (m.mname.node_id, m.mstatic); |
|
187 |
|
|
188 |
fprintf fmt "extern %a;@.@." |
|
189 |
(print_clear_prototype self) (m.mname.node_id, m.mstatic); |
|
190 |
|
|
178 | 191 |
fprintf fmt "extern %a;@.@." |
179 | 192 |
(print_step_prototype self) |
180 | 193 |
(m.mname.node_id, m.mstep.step_inputs, m.mstep.step_outputs) |
... | ... | |
233 | 246 |
let self = mk_new_name used "self" in |
234 | 247 |
fprintf fmt "extern %a;@.@." |
235 | 248 |
(print_reset_prototype self) (inode.nodei_id, static_inputs); |
236 |
|
|
249 |
|
|
250 |
fprintf fmt "extern %a;@.@." |
|
251 |
(print_init_prototype self) (inode.nodei_id, static_inputs); |
|
252 |
|
|
253 |
fprintf fmt "extern %a;@.@." |
|
254 |
(print_clear_prototype self) (inode.nodei_id, static_inputs); |
|
255 |
|
|
237 | 256 |
fprintf fmt "extern %a;@.@." |
238 | 257 |
(print_step_prototype self) |
239 | 258 |
(inode.nodei_id, inode.nodei_inputs, inode.nodei_outputs) |
... | ... | |
249 | 268 |
match tdecl with |
250 | 269 |
| Tydec_any -> assert false |
251 | 270 |
| Tydec_int -> fprintf fmt "int %s" var |
271 |
| Tydec_real when !Options.mpfr |
|
272 |
-> fprintf fmt "%s %s" Mpfr.mpfr_t var |
|
252 | 273 |
| Tydec_real -> fprintf fmt "double %s" var |
253 |
| Tydec_float -> fprintf fmt "float %s" var
|
|
274 |
(* | Tydec_float -> fprintf fmt "float %s" var *)
|
|
254 | 275 |
| Tydec_bool -> fprintf fmt "_Bool %s" var |
255 | 276 |
| Tydec_clock ty -> pp_c_type_decl filename cpt var fmt ty |
256 | 277 |
| Tydec_const c -> fprintf fmt "%s %s" c var |
Also available in: Unified diff