Skip to content

Commit

Permalink
Add support for OCaml 4.12 (#804)
Browse files Browse the repository at this point in the history
  • Loading branch information
kit-ty-kate authored Nov 23, 2020
1 parent 3dfa797 commit c6c43d7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
16 changes: 12 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,21 @@ scripts:

matrix:
include:
- <<: *opam
os: linux
env: COMPILER=4.12.0+trunk REPOSITORIES=--repo=default,beta=git://github.com/ocaml/ocaml-beta-repository.git,alpha=git://github.com/kit-ty-kate/opam-alpha-repository.git
- <<: *opam
os: linux
env: COMPILER=4.11.1
- <<: *opam
os: osx
env: COMPILER=4.10.0 LIBEV=no
env: COMPILER=4.11.1 LIBEV=no
- <<: *opam
os: linux
env: COMPILER=4.10.0 LIBEV=no PPX_LET=yes
env: COMPILER=4.10.1 LIBEV=no PPX_LET=yes
- <<: *opam
os: linux
env: COMPILER=4.09.0 DOCS=yes
env: COMPILER=4.09.1 DOCS=yes
- <<: *opam
os: linux
env: COMPILER=4.08.1+musl+flambda MUSL=yes
Expand All @@ -200,7 +206,9 @@ matrix:
env: ESY=yes

allow_failures:
- env: COMPILER=4.09.0 DOCS=yes
- env: COMPILER=4.12.0+trunk REPOSITORIES=--repo=default,beta=git://github.com/ocaml/ocaml-beta-repository.git,alpha=git://github.com/kit-ty-kate/opam-alpha-repository.git
- env: COMPILER=4.10.1 LIBEV=no PPX_LET=yes
- env: COMPILER=4.09.1 DOCS=yes
- env: COMPILER=4.08.1+musl+flambda MUSL=yes
- env: COMPILER=4.07.1
- env: COMPILER=4.06.1 LWT_STRESS_TEST=true
Expand Down
7 changes: 2 additions & 5 deletions src/core/lwt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -627,11 +627,8 @@ struct
If multiple [Proxy _] links are traversed, [underlying] updates all the
proxies to point immediately to their final underlying promise. *)
let rec underlying
: 'u 'c. ('a, 'u, 'c) promise -> ('a, underlying, 'c) promise =
fun
(type u)
(type c)
(p : ('a, u, c) promise) ->
: type u c. ('a, u, c) promise -> ('a, underlying, c) promise =
fun p ->

match p.state with
| Fulfilled _ -> (p : (_, underlying, _) promise)
Expand Down
5 changes: 5 additions & 0 deletions src/unix/lwt_unix.cppo.ml
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,11 @@ let choose_async_method = function
| Some am -> am
| None -> !default_async_method_var

[@@@ocaml.warning "-16"]
let execute_job ?async_method ~job ~result ~free =
let async_method = choose_async_method async_method in
run_job_aux async_method job (fun job -> let x = wrap_result result job in free job; x)
[@@@ocaml.warning "+16"]

external self_result : 'a job -> 'a = "lwt_unix_self_result"
(* returns the result of a job using the [result] field of the C
Expand Down Expand Up @@ -1819,6 +1821,9 @@ type socket_bool_option =
| SO_DEBUG
| SO_BROADCAST
| SO_REUSEADDR
#if OCAML_VERSION >= (4, 12, 0)
| SO_REUSEPORT
#endif
| SO_KEEPALIVE
| SO_DONTROUTE
| SO_OOBINLINE
Expand Down
3 changes: 3 additions & 0 deletions src/unix/lwt_unix.cppo.mli
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,9 @@ type socket_bool_option =
| SO_DEBUG
| SO_BROADCAST
| SO_REUSEADDR
#if OCAML_VERSION >= (4, 12, 0)
| SO_REUSEPORT
#endif
| SO_KEEPALIVE
| SO_DONTROUTE
| SO_OOBINLINE
Expand Down

0 comments on commit c6c43d7

Please sign in to comment.