caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Mathias Kende <mathias@kende.fr>
To: Jianzhou Zhao <jianzhou@seas.upenn.edu>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] OCaml Int64 <-> C int64_t
Date: Wed, 18 Aug 2010 20:47:52 +0200	[thread overview]
Message-ID: <1282157272.10419.5.camel@mathias-ens> (raw)
In-Reply-To: <AANLkTikaXvDotspy_cMg=8_GaR=6GOur7UYXu3B=yFve@mail.gmail.com>

Le mercredi 18 août 2010 à 14:16 -0400, Jianzhou Zhao a écrit :
> Does caml_copy_int64 do all I want?

I believe so, but then I don't know what you want...

> 
> int64_t C_fun();
> 
> CAMLprim value stub()
> {
>   return (caml_copy_int64 (C_fun()));
> }
> 
> Do we still need I64_of_intnat? It is not included in <caml/alloc.h>
> or other headers.

INT64_of_intnat is an internal macro. There is no reason to use it. Your
snippet of code seems correct, but remember that caml_copy_int64 will
allocate values in the heap so you need to use the CAMLparam/CAMLreturn
macro if your function receives arguments from the caml world.


      reply	other threads:[~2010-08-18 18:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-18 17:28 Jianzhou Zhao
2010-08-18 17:36 ` [Caml-list] " Mathias Kende
2010-08-18 18:16   ` Jianzhou Zhao
2010-08-18 18:47     ` Mathias Kende [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1282157272.10419.5.camel@mathias-ens \
    --to=mathias@kende.fr \
    --cc=caml-list@yquem.inria.fr \
    --cc=jianzhou@seas.upenn.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).