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 ------------------------------------------------------------