Fix generated C code calling between().
This commit is contained in:
parent
a15276f053
commit
36d93a411d
2 changed files with 3 additions and 2 deletions
|
@ -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]
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue