On 20.07.2012 22:56, jcooper wrote:
> although I don't know what to do about <inttypes.h>
That's a tough nut to crack. First I'll note that you probably want
<stdint.h>, which provides the actual types. <inttypes.h> provides some
C-style functions to convert strings to integers.
ODE's internals are written in C++, and C++98 does not know about
<inttypes.h> nor <stdint.h>. C++11 does provide <cstdint>. <cinttypes>
doesn't exist because the string-to-int conversions are handled through
iostreams. However, C++11 support was introduced in VS2010, so this
won't help with earlier versions.
The <inttypes.h> and <stdint.h> headers come from C99. ODE's external
API is C, so we could say it's C99 and get <stdint.h> that way. But
Visual Studio didn't support C99 either prior to the 2010 edition, so
this again won't help.
That leaves the option of shipping our own version of the integer types.
It appears odeconfig.h already defines these; maybe that could be used
in one way or another?
It's also possible to use some template magic to obtain sized integer
types in C++ in a platform-independent way, but that may not be a usable
approach if the types need to be used in a C header.
--
Mikko