Closed emillon closed 4 years ago
Where it's mostly used to print something in the C side, I'm not very convince to add inttypes.h
just for that. A better idea (according the fact that this file is generated), IHMO, should be to fake PRIu64
with something else by the -D
option or another header C file. ocaml-freestanding
should be smallest as we can.
@emillon:
musl inttypes.h depends on a fair bit of libc "infrastructure", however all we would support from it are the printf format string macros. So, as a minimum, you'd need to replace the #if UINTPTR_MAX == UINT64_MAX
block with some #if
logic that compiles correctly on the architectures we support.
As @dinosaure says, in general we want to keep ocaml-freestanding as small as possible, so it may be better to disable the offending code (given that it's just for debug), or patch the source to add some #defines
.
Hello,
I'm trying to build a library that uses
<inttypes.h>
, more specifically it's inhacl
- thePRIu64
macro is used - it should expand to a format string specifier. This C99 header are unfortunately not supported inocaml-freestanding
.In this particular case I might be able to patch my way around this problem (this debug code can be stripped), but this is not ideal as this code is extracted, so I'd rather not touch it too much.
How would I go about adding support for
<inttypes.h>
? can I just addinttypes.h
innolibc/include/
?(same would apply to
bswap64
- I recall adding it to a couple libraries because it was missing in freestanding)Thanks!