Many projects have a need for bitspecific typedefs, and each of them
has the problem to make a header file that defines them, with the
additional need to make short identifiers that do not accidently
redefine the same symbol from another package. SDL is among these.
The unix opengroup were among those to push the topic - as more and
more 64-bit platforms emerged, the
void* were not anymore
just 32-bit. The idea of an inttypes.h was born and fixed in 1997.
The ISO C9X picked it up and extended the idea far beyond, and called
it stdint.h when C99 was fixed.
Projects can pick this up using these single strictly defined inttypes
whereever there is a need for. However not all platforms have this
standard-C header file so far. Quite some libraries started to typedef
them if the system does not have them - but everywhere a little bit
different, adressing some platforms morre or just don’t, possibly even
in the presence of other library headers to typedef their inttypes
when their configure-script detected missing inttypes too.
The gstdint.h project tries to throw a possible solution into the ring.
First, it provides a single autoconf-macro that projects can reuse in
their configure-scripts, and the generated header can never stomp on
inttypes from other headers from autoconf’ed projects. And secondly it
is a true package with uniquly known header file gstdint.h that other
projects may possibly just make themselves depend on. As you like it.
Now - I have a problem too - most platforms that I have access to,
they are too common - just win32 or unix98 compatible. What about the
weird platforms, possibly some that other inttype-redefines did
never try on, and possibly just fail right away? AFAIK the SDL users
are among those to be part of a project being ported to lots and lots
of platforms while at the same having the need for bitspecific inttypes
in their header declarations. So please, have a look at the gstdint.h
project, download and
configure, watch for what the macro detects,
and have a look at the generated file if it looks just right. I’d be
honoured to see the mention your findings in the list of platforms
that gstdint works on.
TIA, Guido http://ac-archive.sf.net/gstdint
P.S. and some day, SDL will be using standard inttypes too, right?