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

Interim fix for ocaml_string/const issues #646

Merged
merged 1 commit into from
Apr 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/ctypes/ctypes_cstubs_internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@
#include "ctypes_raw_pointer.h"
#include "ctypes_managed_buffer_stubs.h"
#include <caml/threads.h>
/* The cast here removes the 'const' qualifier in recent
versions of OCaml because ctypes doesn't yet support const.

TODO: when ctypes supports cv-qualifiers, remove the cast. */
#define CTYPES_PTR_OF_OCAML_STRING(s) \
(String_val(Field(s, 1)) + Long_val(Field(s, 0)))
((char *)String_val(Field(s, 1)) + Long_val(Field(s, 0)))

#ifdef Bytes_val
#define CTYPES_PTR_OF_OCAML_BYTES(s) \
Expand Down