Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove %caml_string_set16u, use the bytes equivalent #36

Closed
wants to merge 1 commit into from

Conversation

hhugo
Copy link

@hhugo hhugo commented Nov 25, 2019

this is in preparation for ocsigen/js_of_ocaml#923

@hhugo
Copy link
Author

hhugo commented Nov 27, 2019

Note that the patch doesn't work with OCaml < 4,07.

@dinosaure
Copy link
Member

Thanks, let me think about a compatibility way 👍

@hhugo
Copy link
Author

hhugo commented Nov 27, 2019

With a light https://github.com/ocsigen/js_of_ocaml/blob/master/compiler/ppx/ppx_optcomp_light.ml
version of ppx_optcomp

Here is how jsoo does it.

external unsafe_set_uint16 : bytes -> int -> int -> unit = "%caml_string_set16u"
  [@@noalloc] [@@if ocaml_version < (4, 7, 0)]

external unsafe_set_uint16 : bytes -> int -> int -> unit = "%caml_bytes_set16u"
  [@@noalloc] [@@if ocaml_version >= (4, 7, 0)]

@dinosaure
Copy link
Member

Ok, I will try to propose a PR with your commit, thanks!

@dinosaure
Copy link
Member

Close by #37.

@dinosaure dinosaure closed this Nov 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants