From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id D5A1BBB81 for ; Fri, 22 Jul 2005 07:26:25 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j6M5QPT5027274 for ; Fri, 22 Jul 2005 07:26:25 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id HAA24181 for ; Fri, 22 Jul 2005 07:26:24 +0200 (MET DST) Received: from smtp109.sbc.mail.mud.yahoo.com (smtp109.sbc.mail.mud.yahoo.com [68.142.198.208]) by nez-perce.inria.fr (8.13.0/8.13.0) with SMTP id j6M5QNHA027271 for ; Fri, 22 Jul 2005 07:26:24 +0200 Received: (qmail 70199 invoked from network); 22 Jul 2005 05:26:23 -0000 Received: from unknown (HELO ?192.168.1.100?) (rftp@pacbell.net@63.194.18.166 with plain) by smtp109.sbc.mail.mud.yahoo.com with SMTP; 22 Jul 2005 05:26:23 -0000 Message-ID: <42E08396.4040502@rftp.com> Date: Thu, 21 Jul 2005 22:26:46 -0700 From: Robert Roessler Organization: Robert's High-performance Software User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Caml-list Subject: Re: [Caml-list] A pair of "Interfacing with C" questions References: <42DF2A64.4000600@rftp.com> <20050721.192154.31710299.garrigue@math.nagoya-u.ac.jp> <20050721.205120.112787682.garrigue@math.nagoya-u.ac.jp> In-Reply-To: <20050721.205120.112787682.garrigue@math.nagoya-u.ac.jp> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 42E08381.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 42E0837F.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 interfacing:01 malc:01 malc:01 pulsesoft:01 nativeint:01 mlvalues:01 nativeint:01 pointer:01 sizeof:01 sizeof:01 aargh:01 ocaml:01 casts:01 pointer:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 Jacques Garrigue wrote: > From: malc > >>>>I assume the other choices include int64, nativeint, or even int. >>> >>>If you look at mlvalues.h you will see that nativeint is define as >>>long int. So this should be the natural format for a pointer. >> >>I don't think so, Win64 ABI has sizeof(long) == 4 and sizeof(void *) == 8. > > > Aargh, they seem to like to break everything! > Anyway, I suppose it just means that ocaml would have to define value > as a long long int on Win64, to make it behave like other > architectures. > The sources are full of casts from value to (value *) and back. > Rather, this is going to be a pain to port many C libraries, that > assume that you can convert between a long and a pointer and back. I was worried about something like the Win64 silliness... ;) Said silliness aside, I will go ahead and switch to nativeint - thanks. Robert Roessler roessler@rftp.com http://www.rftp.com