Skip to content

Commit

Permalink
configurator: C_define: When the number is ≥ 0, prefix it with '0'
Browse files Browse the repository at this point in the history
The function int_of_string in OCaml 4.02 does not support a leading '+'.

Fixes #1738

Signed-off-by: Christophe Troestler <[email protected]>
  • Loading branch information
Chris00 committed Jan 4, 2019
1 parent 0627b62 commit c524b6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/configurator/v1.ml
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ module C_define = struct
#define DUNE_D7(x) ('0'+(DUNE_ABS(x)/10000000 )%%10), DUNE_D6(x)
#define DUNE_D8(x) ('0'+(DUNE_ABS(x)/100000000 )%%10), DUNE_D7(x)
#define DUNE_D9(x) ('0'+(DUNE_ABS(x)/1000000000)%%10), DUNE_D8(x)
#define DUNE_SIGN(x) ((x >= 0)? '+': '-')
#define DUNE_SIGN(x) ((x >= 0)? '0': '-')
|}
);
List.iteri vars ~f:(fun i (name, t) ->
Expand Down

0 comments on commit c524b6c

Please sign in to comment.