After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 703885 - [osx build] error: redefinition of typedef
[osx build] error: redefinition of typedef
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-gl
git master
Other All
: Normal normal
: 1.1.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-07-09 16:30 UTC by Julien Isorce
Modified: 2013-07-11 08:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
rewrite forward declarations (10.64 KB, patch)
2013-07-09 16:30 UTC, Julien Isorce
needs-work Details | Review
fix cocoa build (2.39 KB, patch)
2013-07-09 16:30 UTC, Julien Isorce
accepted-commit_now Details | Review
rewrite forward declarations (23.91 KB, patch)
2013-07-10 10:22 UTC, Julien Isorce
none Details | Review
fix cocoa build (2.39 KB, patch)
2013-07-10 15:07 UTC, Julien Isorce
committed Details | Review
rewrite forward declarations (19.06 KB, patch)
2013-07-10 15:08 UTC, Julien Isorce
committed Details | Review

Description Julien Isorce 2013-07-09 16:30:08 UTC
Created attachment 248748 [details] [review]
rewrite forward declarations

gst-1.0

building gst-plugins-gl on macosx mountain lion gives errors: "redefinition of typedef"

I am using macports to build gstreamer

See the 2 attached patchs.

0001-cocoa-fix-build-when-GNUSTEP-is-not-defined.patch 
0002-build-fix-repeated-typedefs.patch

The first one is not really related to the subject of this bug but it helps to build it.

In the last one I wrote "forward declarations" in an other way.
I would like to have your review before to push it.

Cheers,
Julien
Comment 1 Julien Isorce 2013-07-09 16:30:53 UTC
Created attachment 248749 [details] [review]
fix cocoa build
Comment 2 Sebastian Dröge (slomo) 2013-07-09 18:29:33 UTC
Comment on attachment 248748 [details] [review]
rewrite forward declarations

I don't think that's the correct solution to this. What exactly is the problem? Circular header includes?
Comment 3 Julien Isorce 2013-07-09 21:14:34 UTC
Yes circular header includes. I only get the complier error with i686-apple-darwin11-llvm-gcc-4.2.
It seems to reject the current use of forward declaration.
Comment 4 Sebastian Dröge (slomo) 2013-07-10 06:59:12 UTC
Ah, so the Apple compiler does not like duplicated typedefs? I wonder why we don't have that in GStreamer, I'm sure the same is used there in some places for circular includes...

Is it a compiler warning or an error? And which are the circular includes and types involved?
Comment 5 Julien Isorce 2013-07-10 10:05:13 UTC
(In reply to comment #4)
> Ah, so the Apple compiler does not like duplicated typedefs? 

Yes:

The one that comes with Xcode to build apps on ios (Iphone/Ipad)

i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.11~182/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.11~182/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)



Same result when using Xcode and making a C project for OSX: "redefinition of typedef is a C11 feature". And it seems that the apple compiler does not support C11


I do not have the error with gcc that comes from macports:


gcc-mp-4.7 (MacPorts gcc47 4.7.3_1) 4.7.3
Using built-in specs.
COLLECT_GCC=gcc-mp-4.7
COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/x86_64-apple-darwin12/4.7.3/lto-wrapper
Target: x86_64-apple-darwin12
Configured with: ../gcc-4.7.3/configure --prefix=/opt/local --build=x86_64-apple-darwin12 --enable-languages=c,c++,objc,obj-c++,lto,fortran,java --libdir=/opt/local/lib/gcc47 --includedir=/opt/local/include/gcc47 --infodir=/opt/local/share/info --mandir=/opt/local/share/man --datarootdir=/opt/local/share/gcc-4.7 --with-libiconv-prefix=/opt/local --with-local-prefix=/opt/local --with-system-zlib --disable-nls --program-suffix=-mp-4.7 --with-gxx-include-dir=/opt/local/include/gcc47/c++/ --with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --with-ppl=/opt/local --with-cloog=/opt/local --enable-cloog-backend=isl --disable-cloog-version-check --enable-stage1-checking --disable-multilib --enable-lto --enable-libstdcxx-time --with-as=/opt/local/bin/as --with-ld=/opt/local/bin/ld --with-ar=/opt/local/bin/ar --with-bugurl=https://trac.macports.org/newticket --disable-ppl-version-check --with-pkgversion='MacPorts gcc47 4.7.3_1'
Thread model: posix
gcc version 4.7.3 (MacPorts gcc47 4.7.3_1) 


> I wonder why we
> don't have that in GStreamer, I'm sure the same is used there in some places
> for circular includes...

I thought too so I did a quick search and I could not find one example from GStreamer.

> 
> Is it a compiler warning or an error? And which are the circular includes and
> types involved?

Apparently GstGLDisplay, GstGLWindow, GstGLShader, GstGLDownload etc ...


Also I forgot to add lot of files in my patch, so a new patch follows!
Comment 6 Sebastian Dröge (slomo) 2013-07-10 10:07:26 UTC
Maybe add a single file with all the typedefs then instead of adding 20 files :)
Comment 7 Julien Isorce 2013-07-10 10:22:21 UTC
Created attachment 248820 [details] [review]
rewrite forward declarations
Comment 8 Sebastian Dröge (slomo) 2013-07-10 10:26:10 UTC
Please put all the forward declarations into a single file. Also gl/gstgl.h should probably be gl/gl.h for consistency with the other gstreamer include-all headers.
Comment 9 Julien Isorce 2013-07-10 15:07:26 UTC
Created attachment 248841 [details] [review]
fix cocoa build
Comment 10 Julien Isorce 2013-07-10 15:08:00 UTC
Created attachment 248842 [details] [review]
rewrite forward declarations
Comment 11 Sebastian Dröge (slomo) 2013-07-11 08:21:42 UTC
commit 5ced1567c070636372486adf3aa0371df5a12b13
Author: Julien Isorce <julien.isorce@gmail.com>
Date:   Wed Jul 10 16:03:04 2013 +0100

    build: fix repeated typedefs
    
    Write forward declarations in another way to avoid
    repeated typedefs "error: redefinition of typedef".
    Raised when using i686-apple-darwin11-llvm-gcc-4.2
    It seems that C apple compiler does not support
    C11 feature.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=703885

commit 6a98bc46bd4a10296d3ec03443eba817612f20c2
Author: Julien Isorce <julien.isorce@gmail.com>
Date:   Wed Jul 10 15:47:23 2013 +0100

    cocoa: fix build when GNUSTEP is not defined