Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
It would be nice if <caml/*.h> didn't define types like "int64" #6517
Original bug ID: 6517
Headers like <caml/config.h> define a number of types without
As an example it is not possible to combine the headers:
which currently causes compilation problems in camlimages.
Note that it is illegal to define any identifier ending in *_t in C99.
The full list of problematic types is:
Of these, int32, uint32, int64 and uint64 are the most problematic, and
The *_t typedefs are illegal as noted above.
Likely it will be impossible to get rid of value since it is used all
Steps to reproduce
To get a list of types defined by a header, do:
echo '#include <caml/config.h>' > types.c
and then examine the *.ads files in the current directory.
Comment author: @xavierleroy
I agree that we should change int32, uint32, int64 and uint64 to their C99 equivalents (with the usual hacks for MSVC). I'm afraid we have to live with the other types for backward compatibility: changing e.g. "value" would break a zillion Caml-C stub codes.
Comment author: Richard Jones
Yup a few packages need updating. Fedora has integrated this patch into our OCaml 4.02.0 release, and have patched a few packages as a result. I've sent the patches upstream, where I can easily find an upstream contact, but you can also check our git repo for each package, eg:
(replace ocaml-ocamlnet with Fedora package name)