diff --git a/compiler/obc/c/cgen.ml b/compiler/obc/c/cgen.ml index 502d75b..d7f6135 100644 --- a/compiler/obc/c/cgen.ml +++ b/compiler/obc/c/cgen.ml @@ -756,7 +756,8 @@ let cfile_list_of_oprog_ty_decls name oprog = let (cty_defs, cty_decls) = List.split cdefs_and_cdecls in let filename_types = name ^ "_types" in let types_h = (filename_types ^ ".h", - Cheader (["stdbool"; "assert"], List.concat cty_decls)) in + Cheader (["stdbool"; "assert"; "pervasives"], + List.concat cty_decls)) in let types_c = (filename_types ^ ".c", Csource (concat cty_defs)) in filename_types, [types_h; types_c] diff --git a/lib/c/pervasives.h b/lib/c/pervasives.h index a0b353e..4dea115 100644 --- a/lib/c/pervasives.h +++ b/lib/c/pervasives.h @@ -4,7 +4,7 @@ #define DECADES_PERVASIVES_H /* between(i, n) returns idx between 0 and n-1. */ -inline int between(int idx, int n) +static inline int between(int idx, int n) { int o = (idx >= n) ? n-1 : (idx < 0 ? 0 : idx); return o;