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 LAA05241; Wed, 31 Oct 2001 11:22:13 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 LAA05224 for ; Wed, 31 Oct 2001 11:22:12 +0100 (MET) Received: from relay.rinet.ru (relay.rinet.ru [195.54.192.35]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f9VAMB118832 for ; Wed, 31 Oct 2001 11:22:11 +0100 (MET) Received: (from uucp@localhost) by relay.rinet.ru (8.11.6/8.11.6) with UUCP id f9VAM5908756 for caml-list@inria.fr; Wed, 31 Oct 2001 13:22:05 +0300 (MSK) X-Envelope-To: caml-list@inria.fr Received: from bely.stormoff (BELY) [192.168.0.10] by stormoff with esmtp (Exim 2.05 #1 (Debian)) id 15ysUC-0000Aa-00; Wed, 31 Oct 2001 13:20:40 +0300 X-Comment-To: John Gerard Malecki To: caml-list@inria.fr Subject: Re: [Caml-list] Camlidl and order of include files References: <15327.13008.977353.705352@brainiac.artisan.com> From: Dmitry Bely Date: 31 Oct 2001 13:18:12 +0300 In-Reply-To: <15327.13008.977353.705352@brainiac.artisan.com> Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Academic Rigor) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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