From: "Markus Weißmann" <markus.weissmann@in.tum.de>
To: Gerd Stolpmann <info@gerd-stolpmann.de>
Cc: Adrien Nader <adrien@notk.org>, <caml-list@inria.fr>
Subject: Re: [Caml-list] detecting 32/64 bit from C
Date: Tue, 13 Oct 2015 16:19:37 +0200 [thread overview]
Message-ID: <e7e2004652a67f5f3461c9e672211a92@in.tum.de> (raw)
In-Reply-To: <1444745220.3982.2.camel@e130.lan.sumadev.de>
Perfect -- thanks a lot!
-Markus
On 2015-10-13 16:07, Gerd Stolpmann wrote:
> Am Dienstag, den 13.10.2015, 14:24 +0200 schrieb Adrien Nader:
>> On Tue, Oct 13, 2015, Markus Weißmann wrote:
>> > Hello,
>> >
>> > is there some "official" way to detect -- from C -- if OCaml was
>> > compiled for 32 or 64 bit?
>> > I'd love to have something like a #define that either says 32 or
>> 64
>> > bit;
>> > I need to know at compile time if the OCaml system uses 31 or 63
>> bit
>> > sized integers (in the C code).
>> > I don't care what the underlying OS or hardware does, but just
>> what
>> > OCaml is using.
>> >
>> > Btw.: Is [Sys.word_size = 32] for 32 bit OCaml compilers on 64 bit
>> > machines?
>
> Yes.
>
>>
>> Hi,
>>
>> I believe config.h has the info you want:
>> #define ARCH_SIXTYFOUR // for instance
>
> Exactly.
>
>> Note how it's installed under $(libdir) and not $(includedir): its
>> content is set at configure-time and depends on the architecture
>> that
>> ocaml has been configured for.
>
> config.h should be available in $stdlib/caml. It is included from the
> other header files.
>
> Gerd
>
>> --
>> Adrien Nader
>>
--
Markus Weißmann, M.Sc.
Technische Universität München
Institut für Informatik
Boltzmannstr. 3
D-85748 Garching
Germany
http://wwwknoll.in.tum.de/
prev parent reply other threads:[~2015-10-13 14:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-13 12:04 Markus Weißmann
2015-10-13 12:24 ` Adrien Nader
2015-10-13 14:07 ` Gerd Stolpmann
2015-10-13 14:19 ` Markus Weißmann [this message]
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=e7e2004652a67f5f3461c9e672211a92@in.tum.de \
--to=markus.weissmann@in.tum.de \
--cc=adrien@notk.org \
--cc=caml-list@inria.fr \
--cc=info@gerd-stolpmann.de \
/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