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

host_endian appears to be broken #72

Closed
haesbaert opened this issue Aug 19, 2015 · 2 comments · Fixed by ocaml/opam-repository#21051
Closed

host_endian appears to be broken #72

haesbaert opened this issue Aug 19, 2015 · 2 comments · Fixed by ocaml/opam-repository#21051
Labels

Comments

@haesbaert
Copy link
Member

cstruct bpf_hdr {
    uint32_t     bh_sec;
    uint32_t     bh_usec;
    uint32_t     bh_caplen;
    uint32_t     bh_datalen;
    uint16_t     bh_hdrlen;
} as host_endian

Fails to find Cstruct.HE while little_endian and big_endian work fine:
Error: Unbound module Cstruct.HE

OS X with ocaml 4.02.3

@djs55
Copy link
Member

djs55 commented Mar 12, 2016

Interesting, I didn't know this feature was supposed to exist ;) but it's clearly in the camlp4 and ppx.

@djs55 djs55 added the bug label Mar 12, 2016
haesbaert added a commit to haesbaert/ocaml-cstruct that referenced this issue Feb 28, 2022
This addresses issue mirage#72, basically host endianness means "don't swap" for
cstruct, so it's pretty straightforward.

With this I can successfully use the following code on haesbaert/rawlink:

[%%cstruct
type bpf_hdr = {
	bh_sec: uint32_t;
	bh_usec: uint32_t;
	bh_caplen: uint32_t;
	bh_datalen: uint32_t;
	bh_hdrlen: uint16_t;
} [@@host_endian]]
haesbaert added a commit to haesbaert/ocaml-cstruct that referenced this issue Feb 28, 2022
This addresses issue mirage#72, basically host endianness means "don't swap" for
cstruct, so it's pretty straightforward.

With this I can successfully use the following code on haesbaert/rawlink:

[%%cstruct
type bpf_hdr = {
	bh_sec: uint32_t;
	bh_usec: uint32_t;
	bh_caplen: uint32_t;
	bh_datalen: uint32_t;
	bh_hdrlen: uint16_t;
} [@@host_endian]]
@haesbaert
Copy link
Member Author

Solved in 9569a8a

hannesm added a commit to hannesm/opam-repository that referenced this issue Mar 29, 2022
…ct-lwt and cstruct-async (6.1.0)

CHANGES:

**breaking changes**
- The deprecated functions `Cstruct.len`, `Cstruct.add_len`, `Cstruct.set_len`,
  and `Cstruct.blit_to_string` have been removed (@hannesm mirage/ocaml-cstruct#291)

- Implement host_endian (@haesbaert mirage/ocaml-cstruct#292, fixes mirage/ocaml-cstruct#72)
- Compatibility with OCaml 5.0.0 (@dinosaure mirage/ocaml-cstruct#294)
- Drop support of OCaml < 4.08.0, remove bigarray-compat dependency
  (@hannesm mirage/ocaml-cstruct#298)
- Fix year in chages (@reynir mirage/ocaml-cstruct#297)
hannesm added a commit to hannesm/opam-repository that referenced this issue Mar 31, 2022
…ct-lwt and cstruct-async (6.1.0)

CHANGES:

**breaking changes**
- The deprecated functions `Cstruct.len`, `Cstruct.add_len`, `Cstruct.set_len`,
  and `Cstruct.blit_to_string` have been removed (@hannesm mirage/ocaml-cstruct#291)

- Implement host_endian (@haesbaert mirage/ocaml-cstruct#292, fixes mirage/ocaml-cstruct#72)
- Compatibility with OCaml 5.0.0 (@dinosaure mirage/ocaml-cstruct#294)
- Drop support of OCaml < 4.08.0, remove bigarray-compat dependency
  (@hannesm mirage/ocaml-cstruct#298)
- Fix year in chages (@reynir mirage/ocaml-cstruct#297)
hannesm added a commit to hannesm/opam-repository that referenced this issue Mar 31, 2022
…ct-lwt and cstruct-async (6.1.0)

CHANGES:

**breaking changes**
- The deprecated functions `Cstruct.len`, `Cstruct.add_len`, `Cstruct.set_len`,
  and `Cstruct.blit_to_string` have been removed (@hannesm mirage/ocaml-cstruct#291)

- Implement host_endian (@haesbaert mirage/ocaml-cstruct#292, fixes mirage/ocaml-cstruct#72)
- Compatibility with OCaml 5.0.0 (@dinosaure mirage/ocaml-cstruct#294)
- Drop support of OCaml < 4.08.0, remove bigarray-compat dependency
  (@hannesm mirage/ocaml-cstruct#298)
- Fix year in chages (@reynir mirage/ocaml-cstruct#297)
hannesm added a commit to hannesm/opam-repository that referenced this issue Mar 31, 2022
…ct-lwt and cstruct-async (6.1.0)

CHANGES:

**breaking changes**
- The deprecated functions `Cstruct.len`, `Cstruct.add_len`, `Cstruct.set_len`,
  and `Cstruct.blit_to_string` have been removed (@hannesm mirage/ocaml-cstruct#291)

- Implement host_endian (@haesbaert mirage/ocaml-cstruct#292, fixes mirage/ocaml-cstruct#72)
- Compatibility with OCaml 5.0.0 (@dinosaure mirage/ocaml-cstruct#294)
- Drop support of OCaml < 4.08.0, remove bigarray-compat dependency
  (@hannesm mirage/ocaml-cstruct#298)
- Fix year in chages (@reynir mirage/ocaml-cstruct#297)
hannesm added a commit to hannesm/opam-repository that referenced this issue Apr 1, 2022
…ct-lwt and cstruct-async (6.1.0)

CHANGES:

**breaking changes**
- The deprecated functions `Cstruct.len`, `Cstruct.add_len`, `Cstruct.set_len`,
  and `Cstruct.blit_to_string` have been removed (@hannesm mirage/ocaml-cstruct#291)

- Implement host_endian (@haesbaert mirage/ocaml-cstruct#292, fixes mirage/ocaml-cstruct#72)
- Compatibility with OCaml 5.0.0 (@dinosaure mirage/ocaml-cstruct#294)
- Drop support of OCaml < 4.08.0, remove bigarray-compat dependency
  (@hannesm mirage/ocaml-cstruct#298)
- Fix year in changes of 6.0.1 (@reynir mirage/ocaml-cstruct#297)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants