From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA10365; Wed, 31 Oct 2001 16:20:02 +0100 (MET) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA10325 for ; Wed, 31 Oct 2001 16:20:01 +0100 (MET) Received: from bastion.artisan.com ([209.144.161.130]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f9VFJx128850 for ; Wed, 31 Oct 2001 16:20:00 +0100 (MET) Received: from ypmaster.artisan.com (ypmaster [172.16.2.1]) by bastion.artisan.com (8.9.2/8.9.2) with ESMTP id HAA19969; Wed, 31 Oct 2001 07:20:21 -0800 (PST) Received: from brainiac.artisan.com (brainiac [172.16.10.88]) by ypmaster.artisan.com (8.9.2/8.9.2) with ESMTP id HAA06967; Wed, 31 Oct 2001 07:19:34 -0800 (PST) Received: (from johnm@localhost) by brainiac.artisan.com (8.9.2/8.9.2) id HAA03056; Wed, 31 Oct 2001 07:19:34 -0800 (PST) X-Authentication-Warning: brainiac.artisan.com: johnm set sender to johnm@artisan.com using -f From: John Gerard Malecki MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15328.5766.464942.361033@brainiac.artisan.com> Date: Wed, 31 Oct 2001 07:19:34 -0800 To: Dmitry Bely Cc: caml-list@inria.fr Subject: Re: [Caml-list] Camlidl and order of include files In-Reply-To: References: <15327.13008.977353.705352@brainiac.artisan.com> X-Mailer: VM 6.92 under Emacs 20.4.1 X-Organization: Artisan Components, Inc. Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi Dmitry, I am satisfied with simply using quote(h,"#include ") Canlidl does not need to know the value of _SC_NPROCESSORS_ONLN only that the type is (something like) an enum. No need for a camlidl bug report but the manual could benefit from an index of the keywords. Thanks for you help. Dmitry Bely wrote (2001-10-31T13:18:12+0300): > John Gerard Malecki writes: > > > I just tried camlidl and am not sure if I am using it wrong or if I > > have encountered a bug. I want to access the (solaris) sysconf system > > routine to find out how many processors on a machine. I wrote this > > idl file > > > > quote(C,"#include ") > > > > enum sysconf_names { > > SC_NPROCESSOR_ONLN = _SC_NPROCESSORS_ONLN > > }; > > > Use quote(h,"#include ") > > and then C stubs will compile, but your code still will be incorrect. How > the generated Caml part will know the value of _SC_NPROCESSORS_ONLN? > Obviously, it is not defined for Camlidl. It should generate an error > message here. It does not, and that's the bug in Camlidl (you can submit a > bug report). As for correct solution, you should either convert > to IDL and then use > > #include unistd.idl > > enum sysconf_names { > SC_NPROCESSOR_ONLN = _SC_NPROCESSORS_ONLN > }; > > or resolve _SC_NPROCESSORS_ONLN macro manually: > > quote(C,"#include ") > > enum sysconf_names { > SC_NPROCESSOR_ONLN = 9 > }; > > Hope to hear from you soon, > Dmitry ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr