From: John Gerard Malecki <johnm@artisan.com>
To: Dmitry Bely <dbely@mail.ru>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Camlidl and order of include files
Date: Wed, 31 Oct 2001 07:19:34 -0800 [thread overview]
Message-ID: <15328.5766.464942.361033@brainiac.artisan.com> (raw)
In-Reply-To: <elnkcduj.fsf@mail.ru>
Hi Dmitry,
I am satisfied with simply using
quote(h,"#include <unistd.h>")
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 <johnm@artisan.com> 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 <unistd.h>")
> >
> > enum sysconf_names {
> > SC_NPROCESSOR_ONLN = _SC_NPROCESSORS_ONLN
> > };
>
>
> Use quote(h,"#include <unistd.h>")
>
> 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 <unistd.h>
> 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 <unistd.h>")
>
> 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
next prev parent reply other threads:[~2001-10-31 15:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-10-30 23:08 John Gerard Malecki
2001-10-31 10:18 ` Dmitry Bely
2001-10-31 15:19 ` John Gerard Malecki [this message]
2001-10-31 17:01 ` Dmitry Bely
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=15328.5766.464942.361033@brainiac.artisan.com \
--to=johnm@artisan.com \
--cc=caml-list@inria.fr \
--cc=dbely@mail.ru \
/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