#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)
Change History (11)
comment:1 by , 19 years ago
comment:2 by , 19 years ago
Owner: | set to |
---|
by , 19 years ago
Attachment: | scummvm_configure.patch added |
---|
Ugly hack to avoid int8 conflict on Solaris
comment:3 by , 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 , 19 years ago
Summary: | Conflicting declaration of int8_t on Solaris → ALL: int8_t in graphics/animation in conflict with ISO99 C |
---|
comment:5 by , 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 , 19 years ago
Owner: | changed from | to
---|---|
Resolution: | → fixed |
Status: | new → closed |
comment:7 by , 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:9 by , 6 years ago
Component: | → Ports |
---|
comment:10 by , 6 years ago
Component: | Ports → Port: Solaris |
---|
config.h is generated by configure script. You may add some solaris-specific defines there. Feel free to attach your patch here.