Bug 326346 - Compilation of giflib fails with error: redefinition of typedef 'bool'
Summary: Compilation of giflib fails with error: redefinition of typedef 'bool'
Status: RESOLVED FIXED
Alias: None
Product: kde-windows
Classification: Miscellaneous
Component: buildsystem (show other bugs)
Version: unspecified
Platform: Microsoft Windows Microsoft Windows
: NOR major
Target Milestone: ---
Assignee: KDE-Windows
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-20 20:23 UTC by dasaan.san
Modified: 2013-11-09 22:27 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
patch against: emerge\portage\win32libs\giflib\giflib-5.0.5-20130916.diff (576 bytes, patch)
2013-10-22 20:55 UTC, dasaan.san
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dasaan.san 2013-10-20 20:23:13 UTC
Whilst trying to emerge kdelibs giflib fails to compile with several errors stating:
error: redefinition of typedef 'bool'

in one instance the files referenced are:
dgif_lib.c:24
gif_lib.h:13
stdbool.h:5

dgif_lib.c contains the following:
#ifdef _WIN32
#include <stdbool.h>
...
#include "gif_lib.h"

stdbool.h contains:
#ifndef __cplusplus
typedef int bool;
...

and gif_lib.h contains:
#ifdef __cplusplus
extern "C" {
#else
typedef int bool;
#endif /* __cplusplus */

therefore if __cplusplus is not defined then the typedef for bool is declared twice.

This also occurs in:
egif_lib.c

Reproducible: Always

Steps to Reproduce:
1. emerge kdelibs
2.
3.
Actual Results:  
emerge of kdelibs fails whilst trying to compile giflib

Expected Results:  
compilation of giflib should have completed successfully and emerge should have then gone on to compile the remainder of kdelibs
Comment 1 dasaan.san 2013-10-20 23:58:39 UTC
Compiler details:

mingw as installed via emerge

c:\kdeRoot>gcc -v
Using built-in specs.
Target: i686-w64-mingw32
Configured with: ../gcc44-svn/configure --host=i686-w64-mingw32 --target=i686-w64-mingw32 --disable-multilib --enable-checking=release --prefix=/mingw32 --with-sysroot=/mingw32 --enable-languages=c,c++,fortran,objc,obj-c++ --enable-libgomp --with-gmp=/mingw32 --with-mpfr=/mingw32 --disable-nls --disable-win32-registry
Thread model: win32
gcc version 4.4.7 20111023 (prerelease) [svn/rev.180339 - mingw-w64/oz] (GCC)
Comment 2 dasaan.san 2013-10-22 20:55:37 UTC
Created attachment 83035 [details]
patch against: emerge\portage\win32libs\giflib\giflib-5.0.5-20130916.diff

patch to prevent accidental re-declaration of the bool typedef
Comment 3 Nico Kruber 2013-11-09 22:27:35 UTC
Git commit ba03bdecc75e08e0fd90159653e6846519422b91 by Nico Kruber.
Committed on 09/11/2013 at 22:27.
Pushed by nkruber into branch 'kde-4.11'.

fix giflib on mingw (patch from dasaan.san@gmail.com)

M  +3    -1    portage/win32libs/giflib/giflib-5.0.5-20130916.diff

http://commits.kde.org/emerge/ba03bdecc75e08e0fd90159653e6846519422b91