Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Gerd Stolpmann <info@gerd-stolpmann.de>
To: Adrien Nader <adrien@notk.org>
Cc: "Markus Weißmann" <markus.weissmann@in.tum.de>, caml-list@inria.fr
Subject: Re: [Caml-list] detecting 32/64 bit from C
Date: Tue, 13 Oct 2015 16:07:00 +0200	[thread overview]
Message-ID: <1444745220.3982.2.camel@e130.lan.sumadev.de> (raw)
In-Reply-To: <20151013122423.GA20981@notk.org>

[-- Attachment #1: Type: text/plain, Size: 1409 bytes --]

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
> 

-- 
------------------------------------------------------------
Gerd Stolpmann, Darmstadt, Germany    gerd@gerd-stolpmann.de
My OCaml site:          http://www.camlcity.org
Contact details:        http://www.camlcity.org/contact.html
Company homepage:       http://www.gerd-stolpmann.de
------------------------------------------------------------


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2015-10-13 14:07 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 [this message]
2015-10-13 14:19     ` Markus Weißmann

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=1444745220.3982.2.camel@e130.lan.sumadev.de \
    --to=info@gerd-stolpmann.de \
    --cc=adrien@notk.org \
    --cc=caml-list@inria.fr \
    --cc=markus.weissmann@in.tum.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