Skip to content

Commit 2dfc521

Browse files
authored
Merge pull request #272 from avsm/fix-406
Fix pre-4.07 code generation with stdlib-shims
2 parents cf75247 + e7cdfe5 commit 2dfc521

File tree

7 files changed

+20
-3
lines changed

7 files changed

+20
-3
lines changed

.github/workflows/test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ jobs:
3737
ocaml-version: ${{ matrix.ocaml-version }}
3838
- run: opam pin add -n .
3939
- name: Packages
40-
run: opam depext -yt cstruct cstruct-sexp cstruct-unix cstruct-lwt
40+
run: opam depext -yt cstruct cstruct-sexp cstruct-unix cstruct-lwt ppx_cstruct
4141
- name: Build
42-
run: opam install -t cstruct cstruct-sexp cstruct-unix cstruct-lwt
42+
run: opam install -t cstruct cstruct-sexp cstruct-unix cstruct-lwt ppx_cstruct
4343
async:
4444
name: Async
4545
runs-on: ${{ matrix.operating-system }}

CHANGES.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
v5.1.1 2019-11-23
2+
-----------------
3+
4+
This is a point release to fix a regression in 5.1.0
5+
on compilers earlier than 4.07.
6+
7+
The release also fixes the test suite and CI on compilers
8+
greater than 4.07.
9+
110
v5.1.0 2019-11-23
211
-----------------
312

ppx/dune

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
(public_name ppx_cstruct)
44
(kind ppx_rewriter)
55
(wrapped false)
6-
(ppx_runtime_libraries cstruct)
6+
(ppx_runtime_libraries cstruct stdlib-shims)
77
(preprocess
88
(pps ppx_tools_versioned.metaquot_404))
99
(libraries sexplib ocaml-migrate-parsetree ppx_tools_versioned

ppx_cstruct.opam

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ depends: [
2525
"ppx_sexp_conv" {with-test}
2626
"sexplib" {>="v0.9.0"}
2727
"cstruct-sexp" {with-test}
28+
"cppo" {with-test}
2829
"cstruct-unix" {with-test & =version}
2930
"stdlib-shims"
3031
]

ppx_test/errors/dune

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
(executable
22
(name pp)
33
(modules pp)
4+
(preprocess (action
5+
(run %{bin:cppo} -V OCAML:%{ocaml_version} %{input-file})))
46
(libraries
57
ppx_cstruct
68
ocaml-migrate-parsetree))

ppx_test/errors/gen_tests.ml

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ let output_stanzas name =
1919

2020
let is_test = function
2121
| "pp.ml" -> false
22+
| "pp.pp.ml" -> false
2223
| "gen_tests.ml" -> false
2324
| e -> Filename.check_suffix e ".ml"
2425

ppx_test/errors/pp.ml

+4
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,8 @@
33
external sys_exit : int -> 'a = "caml_sys_exit"
44
let () = at_exit (fun () -> sys_exit 0)
55

6+
#if OCAML_VERSION >= (4,8,0)
7+
let () = Clflags.(error_style := Some Short)
8+
#endif
9+
610
let () = Migrate_parsetree.Driver.run_main ()

0 commit comments

Comments
 (0)