[Scummvm-devel] Build of ScummVM 0.8.2 on Solaris 10 x86

Laurent Blume laurent at elanor.org
Wed Feb 8 05:37:04 CET 2006


Max Horn wrote:
> Actually, the problem in this particular case is that the external header
> file  mpeg2dec/mpeg2.h seems to assume that int8_t etc. is defined, when
> it really should include the standard header inttypes.h. I consider this a
> bug in that header / lib. The Solaris "int_types.h" header is odd, BTW, I
> wonder if that is based on an older version of the recent C(++) spec :-).

They say it should be standard. If it's not, I can try to open a case 
with them, so it gets better in the future:

  * This file, <sys/int_types.h>, is part of the Sun Microsystems 
implementation
  * of <inttypes.h> defined in the ISO C standard, ISO/IEC 9899:1999
  * Programming language - C.

> Anyway, our workaround for that "bug" in mpeg2dec is flawed. The best
> immediate workaround, IMO, would be to replace those typedefs in
> animation.h by #define's.
> 
> On the long run, we may want to consider moving from our uint8, int32 etc.
> types to the new standard compliant types defined in inttypes.h. Of
> course, we'd still check for the presence of that header, and if it is not
> there, we'd still use our own typedefs. But I think that when possible,
> it's usually better to use the existing standards as much as possible.
> Alas, this is not a quick short term solution!

I asked a friend of mine who is a developer about it, and I now 
understand what's happening.

The int16_t, int32_t redefinitions are not a problem, because they are 
reusing exactly the same declaration as is done already on Solaris.

For int8_t, however, there is a case in int_types.h:

#if defined(_CHAR_IS_SIGNED)
typedef char                    int8_t;
#else
#if defined(__STDC__)
typedef signed char             int8_t;
#endif
#endif

And since _CHAR_IS_SIGNED is defined in isa_defs.h, it's always there by 
default.

So what I see as an immediate solution would be to have configure put 
that in config.h:

#if defined(_CHAR_IS_SIGNED)
typedef char        int8;
#else
typedef signed char int8;
#endif

Would it be ok in the short term?

Laurent




More information about the Scummvm-devel mailing list