From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 8E996BC57 for ; Wed, 18 Aug 2010 20:24:46 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlMEAB7Ca0zRVde0mGdsb2JhbACTCI09CBUBAQEBAQgJDAcRIqY+iyqGUSOIXwEBAwWFMgSJbYg7 X-IronPort-AV: E=Sophos;i="4.56,228,1280700000"; d="scan'208";a="65824795" Received: from mail-ey0-f180.google.com ([209.85.215.180]) by mail1-smtp-roc.national.inria.fr with ESMTP; 18 Aug 2010 20:24:46 +0200 Received: by eya25 with SMTP id 25so665896eya.39 for ; Wed, 18 Aug 2010 11:24:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=9/25TpuqZRTmN89IXiubSyHAJgHV8Nrrd46ZalRNEeM=; b=TWOmiMXMyE2X0lsnx0OcMOunedsXoWMrWcJC0To/7yR7XJaQ9qswt+E9dS8DmnVANx HEsBYyQ40mUvBYlk+L4X5wsexp8OdAMHZKVQSvAHCfaDEX8EB9vfGxzodDquOojBQOE7 gCuLrFwKabUc5A+4d2Fei2cLepgnf/BEMkG1g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=LqddXHQ7SYvUKx4Uzo5pPVQ23g7adoPzb+4QWSb32Y1n1/3ATKfG55RLd0LMlg5d6S +zFYDA5SKl1aj+qZdHk6xr/e6rOL8YxrNB/QZg4x/CoWheRydWpDVcSnAWp2xdvV5K5O lsB7byNwiocG2Vsrc/UjkgbRtMxBC2sc4nz+M= MIME-Version: 1.0 Received: by 10.216.15.68 with SMTP id e46mr2321122wee.97.1282155390572; Wed, 18 Aug 2010 11:16:30 -0700 (PDT) Sender: jianzhou.zh@gmail.com Received: by 10.216.29.67 with HTTP; Wed, 18 Aug 2010 11:16:30 -0700 (PDT) In-Reply-To: <1282152997.21939.13.camel@mathias-ens> References: <1282152997.21939.13.camel@mathias-ens> Date: Wed, 18 Aug 2010 14:16:30 -0400 X-Google-Sender-Auth: 5Oi4y0F_OxpGWJh_5p3uh30eedQ Message-ID: Subject: Re: [Caml-list] OCaml Int64 <-> C int64_t From: Jianzhou Zhao To: Mathias Kende Cc: caml-list@yquem.inria.fr Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; ocaml:01 mlvalues:01 alloc:01 val:01 val:01 camlprim:01 stub:01 alloc:01 zhao:98 mathias:98 mathias:98 zhao:98 wrote:01 upenn:01 heap:01 On Wed, Aug 18, 2010 at 1:36 PM, Mathias Kende wrote: > Le mercredi 18 ao=FBt 2010 =E0 13:28 -0400, Jianzhou Zhao a =E9crit : >> But mlvalues.h does not declare them to use. How can I >> convert int64 to value? > > caml_copy_int64 is declared in . There is no Val_int64 > macro because int64 values are heap objects which must be allocated (the > Val_... macros are mostly just static_cast). Does caml_copy_int64 do all I 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 or other headers. > > Mathias > > --=20 Jianzhou