Skip to content

Commit

Permalink
Merge pull request #286 from hannesm/c-warning
Browse files Browse the repository at this point in the history
Use Bytes_val if available
  • Loading branch information
dinosaure authored Jun 25, 2021
2 parents 1b03707 + b6c07a2 commit f2b14ba
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/cstruct_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@
#include <caml/alloc.h>
#include <caml/bigarray.h>

#ifndef Bytes_val
#define Bytes_val String_val
#endif

CAMLprim value
caml_blit_bigstring_to_string(value val_buf1, value val_ofs1, value val_buf2, value val_ofs2, value val_len)
{
memcpy(String_val(val_buf2) + Long_val(val_ofs2),
memcpy(Bytes_val(val_buf2) + Long_val(val_ofs2),
(char*)Caml_ba_data_val(val_buf1) + Long_val(val_ofs1),
Long_val(val_len));
return Val_unit;
Expand Down

0 comments on commit f2b14ba

Please sign in to comment.