Opened 19 years ago

Closed 19 years ago

Last modified 6 years ago

#2505 closed defect (fixed)

ALL: int8_t in graphics/animation in conflict with ISO99 C

Reported by: SF/lblume Owned by: fingolfin
Priority: normal Component: Port: Solaris
Version: Keywords:
Cc: Game:

Description

Build fails on Solaris 10 because of the following declaration conflict.

In file included from ./engines/sword1/animation.h:26, from engines/sword1/animation.cpp:26: ./graphics/animation.h:35: error: conflicting declaration 'typedef int8 int8_t' /usr/include/sys/int_types.h:54: error: 'int8_t' has a previous declaration as `typedef char int8_t' ./graphics/animation.h:35: error: declaration of `typedef int8 int8_t' /usr/include/sys/int_types.h:54: error: conflicts with previous declaration `typedef char int8_t' ./graphics/animation.h:35: error: declaration of `typedef int8 int8_t' /usr/include/sys/int_types.h:54: error: conflicts with previous declaration `typedef char int8_t' gmake: *** [engines/sword1/animation.o] Error 1

This is because in config.h, int8 is defined as: typedef signed char int8;

but it is already declared differently in int_types.h: #if defined(_CHAR_IS_SIGNED) typedef char int8_t;

The compiler doesn't like the difference, even if it amounts to the same.

As a quick workaround, I modify config.h before building, and it works. I don't know what would be a clean solution, though.

Ticket imported from: #1436178. Ticket imported from: bugs/2505.

Attachments (1)

scummvm_configure.patch (829 bytes ) - added by SF/lblume 19 years ago.
Ugly hack to avoid int8 conflict on Solaris

Download all attachments as: .zip

Change History (11)

comment:1 by sev-, 19 years ago

config.h is generated by configure script. You may add some solaris-specific defines there. Feel free to attach your patch here.

comment:2 by sev-, 19 years ago

Owner: set to sev-

by SF/lblume, 19 years ago

Attachment: scummvm_configure.patch added

Ugly hack to avoid int8 conflict on Solaris

comment:3 by SF/lblume, 19 years ago

Here is a patch for configure, that adds what I think is a ugly hack, but works around the problem on Solaris.

comment:4 by fingolfin, 19 years ago

Summary: Conflicting declaration of int8_t on SolarisALL: int8_t in graphics/animation in conflict with ISO99 C

comment:5 by fingolfin, 19 years ago

Changing the definition of type int8 is the wrong solution, and not acceptable.

The real bug is that graphics/animation.h redefines the int8_t datatype, which is part of ISO99 C.

comment:6 by fingolfin, 19 years ago

Owner: changed from sev- to fingolfin
Resolution: fixed
Status: newclosed

comment:7 by fingolfin, 19 years ago

If fixed this in CVS for now by replacing our custom typedefs by #include <inttypes.h>

Of course this might cause problems on systems that don't have inttypes.h. But since libmpeg2 / mpeg2dec also does #include <inttypes.h>, it can only be compiled when that header is present, so it *should* be fine... If it is not, then I will deal with that once we get bug reports from people with mpeg2dec but without inttypes.h :-).

comment:8 by SF/lblume, 19 years ago

It builds out of the box now, it feels too easy :-) Thanks!

comment:9 by digitall, 6 years ago

Component: Ports

comment:10 by digitall, 6 years ago

Component: PortsPort: Solaris
Note: See TracTickets for help on using tickets.