[732/906] build: fix repeated typedefs
authorJulien Isorce <julien.isorce@gmail.com>
Wed, 10 Jul 2013 15:03:04 +0000 (16:03 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:31:29 +0000 (19:31 +0000)
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

28 files changed:
gst-libs/gst/gl/Makefile.am
gst-libs/gst/gl/gl.h [new file with mode: 0644]
gst-libs/gst/gl/gstgl_fwd.h [new file with mode: 0644]
gst-libs/gst/gl/gstglapi.h
gst-libs/gst/gl/gstglbufferpool.c
gst-libs/gst/gl/gstglbufferpool.h
gst-libs/gst/gl/gstgldisplay.c
gst-libs/gst/gl/gstgldisplay.h
gst-libs/gst/gl/gstgldownload.c
gst-libs/gst/gl/gstgldownload.h
gst-libs/gst/gl/gstglegl.c
gst-libs/gst/gl/gstglegl.h
gst-libs/gst/gl/gstglfeature.c
gst-libs/gst/gl/gstglfeature.h
gst-libs/gst/gl/gstglfilter.h
gst-libs/gst/gl/gstglframebuffer.c
gst-libs/gst/gl/gstglframebuffer.h
gst-libs/gst/gl/gstglmemory.c
gst-libs/gst/gl/gstglmemory.h
gst-libs/gst/gl/gstglmixer.h
gst-libs/gst/gl/gstglshader.c
gst-libs/gst/gl/gstglshader.h
gst-libs/gst/gl/gstglupload.c
gst-libs/gst/gl/gstglupload.h
gst-libs/gst/gl/gstglutils.c
gst-libs/gst/gl/gstglutils.h
gst-libs/gst/gl/gstglwindow.c
gst-libs/gst/gl/gstglwindow.h

index a1feb3f..e515762 100644 (file)
@@ -74,14 +74,16 @@ libgstgl_@GST_API_VERSION@include_HEADERS = \
        gstglfilter.h \
        gstglmixer.h \
        gstglmixerpad.h \
-    gstglshadervariables.h \
+       gstglshadervariables.h \
        gstglshader.h \
        gstgldownload.h \
        gstglupload.h \
        gstglapi.h \
        gstglfeature.h \
        gstglutils.h \
-       gstglframebuffer.h
+       gstglframebuffer.h \
+       gstgl_fwd.h \
+       gl.h
 
 libgstgl_@GST_API_VERSION@_la_CFLAGS = \
        $(GL_CFLAGS) \
diff --git a/gst-libs/gst/gl/gl.h b/gst-libs/gst/gl/gl.h
new file mode 100644 (file)
index 0000000..940b6c7
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * GStreamer
+ * Copyright (C) 2013 Julien Isorce <julien.isorce@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __GL_H__
+#define __GL_H__
+
+#include "gstgl_fwd.h"
+#include "gstglconfig.h"
+#include "gstglapi.h"
+#include "gstgldisplay.h"
+#include "gstglfeature.h"
+#include "gstglutils.h"
+#include "gstglwindow.h"
+#include "gstglshader.h"
+#include "gstglupload.h"
+#include "gstgldownload.h"
+#include "gstglmemory.h"
+#include "gstglbufferpool.h"
+#include "gstglframebuffer.h"
+#include "gstglfilter.h"
+#include "gstglmixer.h"
+#include "gstglshadervariables.h"
+
+#endif /* __GL_H__ */
diff --git a/gst-libs/gst/gl/gstgl_fwd.h b/gst-libs/gst/gl/gstgl_fwd.h
new file mode 100644 (file)
index 0000000..f0b049e
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * GStreamer
+ * Copyright (C) 2013 Julien Isorce <julien.isorce@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __GST_GL_FWD_H__
+#define __GST_GL_FWD_H__
+
+#include <gst/gst.h>
+
+#include "gstglapi.h"
+
+G_BEGIN_DECLS
+
+typedef struct _GstGLDisplay GstGLDisplay;
+typedef struct _GstGLDisplayClass GstGLDisplayClass;
+typedef struct _GstGLDisplayPrivate GstGLDisplayPrivate;
+
+typedef struct _GstGLWindow        GstGLWindow;
+typedef struct _GstGLWindowPrivate GstGLWindowPrivate;
+typedef struct _GstGLWindowClass   GstGLWindowClass;
+
+typedef struct _GstGLMemory GstGLMemory;
+typedef struct _GstGLAllocator GstGLAllocator;
+typedef struct _GstGLAllocatorClass GstGLAllocatorClass;
+
+typedef struct _GstGLShader        GstGLShader;
+typedef struct _GstGLShaderPrivate GstGLShaderPrivate;
+typedef struct _GstGLShaderClass   GstGLShaderClass;
+
+typedef struct _GstGLDownload GstGLDownload;
+typedef struct _GstGLDownloadClass GstGLDownloadClass;
+typedef struct _GstGLDownloadPrivate GstGLDownloadPrivate;
+
+typedef struct _GstGLUpload GstGLUpload;
+typedef struct _GstGLUploadClass GstGLUploadClass;
+typedef struct _GstGLUploadPrivate GstGLUploadPrivate;
+
+G_END_DECLS
+
+#endif /* __GST_GL_FWD_H__ */
index ef0f45c..ee314cf 100644 (file)
@@ -37,6 +37,7 @@
 # if __APPLE__
 #  include <OpenGL/OpenGL.h>
 #  include <OpenGL/gl.h>
+#  include <OpenGL/glu.h>
 # else
 #  include <GL/glu.h>
 #  include <GL/gl.h>
 #define GSTGLAPI
 #endif
 
-#include "glprototypes/gstgl_compat.h"
-
 #include <gst/gst.h>
 
+#include "glprototypes/gstgl_compat.h"
+
 G_BEGIN_DECLS
 
 typedef enum {
index 7409dd5..cef6ea4 100644 (file)
@@ -22,6 +22,7 @@
 #include "config.h"
 #endif
 
+#include "gl.h"
 #include "gstglbufferpool.h"
 
 /**
index 5f75dca..d4456ba 100644 (file)
@@ -25,8 +25,7 @@
 #include <gst/video/gstvideometa.h>
 #include <gst/video/gstvideopool.h>
 
-#include "gstgldisplay.h"
-#include "gstglmemory.h"
+#include "gstgl_fwd.h"
 
 G_BEGIN_DECLS
 
index b001f80..6a560c1 100644 (file)
@@ -25,8 +25,7 @@
 #include "config.h"
 #endif
 
-#include "gstglmemory.h"
-
+#include "gl.h"
 #include "gstgldisplay.h"
 
 GST_DEBUG_CATEGORY_STATIC (gst_gl_display_debug);
index 3ee6fbc..bfe021d 100644 (file)
 #ifndef __GST_GL_DISPLAY_H__
 #define __GST_GL_DISPLAY_H__
 
-#include "gstglconfig.h"
-
-typedef struct _GstGLWindow GstGLWindow;
-
-#include "gstglwindow.h"
-#include "gstglutils.h"
+#include "gstgl_fwd.h"
 
 G_BEGIN_DECLS
 
@@ -42,10 +37,6 @@ GType gst_gl_display_get_type (void);
 #define GST_IS_GL_DISPLAY_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_GL_DISPLAY))
 #define GST_GL_DISPLAY_CAST(obj)        ((GstGLDisplay*)(obj))
 
-typedef struct _GstGLDisplay GstGLDisplay;
-typedef struct _GstGLDisplayClass GstGLDisplayClass;
-typedef struct _GstGLDisplayPrivate GstGLDisplayPrivate;
-
 /**
  * GstGLDisplayThreadFunc:
  * @display: a #GstGLDisplay
index fa1a381..f7ab882 100644 (file)
@@ -24,8 +24,8 @@
 
 #include <stdio.h>
 
+#include "gl.h"
 #include "gstgldownload.h"
-#include "gstglmemory.h"
 
 /**
  * SECTION:gstgldownload
index cef26ef..ded8a42 100644 (file)
 #include <gst/video/video.h>
 #include <gst/gstmemory.h>
 
-#include "gstgldisplay.h"
-#include "gstglshader.h"
+#include "gstgl_fwd.h"
 
 G_BEGIN_DECLS
 
-/* forward declare */
-typedef struct _GstGLMemory GstGLMemory;
-typedef struct _GstGLDisplay GstGLDisplay;
-
 GType gst_gl_download_get_type (void);
 #define GST_TYPE_GL_DOWNLOAD (gst_gl_download_get_type())
 #define GST_GL_DOWNLOAD(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GL_DOWNLOAD,GstGLDownload))
@@ -41,10 +36,6 @@ GType gst_gl_download_get_type (void);
 #define GST_IS_GL_DOWNLOAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_GL_DOWNLOAD))
 #define GST_GL_DOWNLOAD_CAST(obj) ((GstGLDownload*)(obj))
 
-typedef struct _GstGLDownload GstGLDownload;
-typedef struct _GstGLDownloadClass GstGLDownloadClass;
-typedef struct _GstGLDownloadPrivate GstGLDownloadPrivate;
-
 /**
  * GstGLDownload
  * @parent: the parent object
index f41092c..4097a52 100644 (file)
@@ -22,6 +22,7 @@
 #include "config.h"
 #endif
 
+#include "gl.h"
 #include "gstglegl.h"
 
 static const gchar *
index 426182f..4bfd479 100644 (file)
@@ -24,7 +24,7 @@
 #include <gst/gst.h>
 #include <EGL/egl.h>
 
-#include "gstglwindow.h"
+#include "gstgl_fwd.h"
 
 G_BEGIN_DECLS
 
index 72c347c..f599e48 100644 (file)
 
 #include <string.h>
 
+#include "gl.h"
 #include "gstglfeature.h"
 
-#include "gstglapi.h"
-
 gboolean
 gst_gl_check_extension (const char *name, const gchar * ext)
 {
index 4105d62..eb9a04f 100644 (file)
@@ -45,7 +45,7 @@
 
 #include <gst/gst.h>
 
-#include "gstgldisplay.h"
+#include "gstgl_fwd.h"
 
 #define GST_GL_CHECK_GL_VERSION(driver_major, driver_minor, \
                                 target_major, target_minor) \
index dda8ddd..b989885 100644 (file)
@@ -27,7 +27,7 @@
 #include <gst/base/gstbasetransform.h>
 #include <gst/video/video.h>
 
-#include "gstglbufferpool.h"
+#include "gl.h"
 
 G_BEGIN_DECLS
 
index 1b574d2..ae8bb5e 100644 (file)
@@ -21,6 +21,7 @@
 #include "config.h"
 #endif
 
+#include "gl.h"
 #include "gstglframebuffer.h"
 
 GST_DEBUG_CATEGORY_STATIC (gst_gl_framebuffer_debug);
index 48250db..1f5fcc8 100644 (file)
@@ -21,7 +21,7 @@
 #ifndef __GST_GL_FRAMEBUFFER_H__
 #define __GST_GL_FRAMEBUFFER_H__
 
-#include "gstgldisplay.h"
+#include "gstgl_fwd.h"
 
 G_BEGIN_DECLS
 
index 1d5542b..e832994 100644 (file)
@@ -25,7 +25,6 @@
 #include <gst/video/video.h>
 
 #include "gstglmemory.h"
-#include "gstglutils.h"
 
 /**
  * SECTION:gstglmemory
index 1556951..7bec6cd 100644 (file)
 #define _GST_GL_MEMORY_H_
 
 #include <gst/gst.h>
-#include <gst/gstmemory.h>
 #include <gst/gstallocator.h>
+#include <gst/gstmemory.h>
+#include <gst/video/video.h>
 
-#include "gstgldisplay.h"
-#include "gstgldownload.h"
-#include "gstglupload.h"
+#include "gl.h"
 
 G_BEGIN_DECLS
 
@@ -41,10 +40,6 @@ GType gst_gl_allocator_get_type(void);
 #define GST_GL_ALLOCATOR_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_GL_ALLOCATOR, GstGLAllocatorClass))
 #define GST_GL_ALLOCATOR_CAST(obj)            ((GstGLAllocator *)(obj))
 
-typedef struct _GstGLMemory GstGLMemory;
-typedef struct _GstGLAllocator GstGLAllocator;
-typedef struct _GstGLAllocatorClass GstGLAllocatorClass;
-
 /**
  * GstGLMemoryFlags:
  *
index c089d59..3e287d5 100644 (file)
@@ -25,7 +25,7 @@
 #include <gst/video/video.h>
 #include "gstglmixerpad.h"
 
-#include "gstglbufferpool.h"
+#include "gl.h"
 
 G_BEGIN_DECLS
 
index a3c3cdc..b412420 100644 (file)
@@ -22,6 +22,7 @@
 #include "config.h"
 #endif
 
+#include "gl.h"
 #include "gstglshader.h"
 
 #ifndef GL_COMPILE_STATUS
index cd06195..a75f3fd 100644 (file)
 #ifndef __GST_GL_SHADER_H__
 #define __GST_GL_SHADER_H__
 
-#include "gstgldisplay.h"
-#include <gst/gst.h>
+#include "gstgl_fwd.h"
 
 G_BEGIN_DECLS
 
-typedef struct _GstGLDisplay GstGLDisplay;
-
 #define GST_GL_TYPE_SHADER         (gst_gl_shader_get_type())
 #define GST_GL_SHADER(o)           (G_TYPE_CHECK_INSTANCE_CAST((o), GST_GL_TYPE_SHADER, GstGLShader))
 #define GST_GL_SHADER_CLASS(k)     (G_TYPE_CHECK_CLASS((k), GST_GL_TYPE_SHADER, GstGLShaderClass))
@@ -48,10 +45,6 @@ typedef enum {
   GST_GL_SHADER_VERTEX_SOURCE
 } GstGLShaderSourceType;
 
-typedef struct _GstGLShader        GstGLShader;
-typedef struct _GstGLShaderPrivate GstGLShaderPrivate;
-typedef struct _GstGLShaderClass   GstGLShaderClass;
-
 struct _GstGLShader {
   /*< private >*/
   GObject parent;
index 30de512..8b58709 100644 (file)
@@ -24,8 +24,8 @@
 
 #include <stdio.h>
 
+#include "gl.h"
 #include "gstglupload.h"
-#include "gstglmemory.h"
 
 /**
  * SECTION:gstglupload
index 2daafd7..8b93bca 100644 (file)
 #include <gst/video/video.h>
 #include <gst/gstmemory.h>
 
-#include "gstglshader.h"
-#include "gstgldisplay.h"
+#include "gstgl_fwd.h"
 
 G_BEGIN_DECLS
 
-/* forward declare */
-typedef struct _GstGLMemory GstGLMemory;
-typedef struct _GstGLDisplay GstGLDisplay;
-
 GType gst_gl_upload_get_type (void);
 #define GST_TYPE_GL_UPLOAD (gst_gl_upload_get_type())
 #define GST_GL_UPLOAD(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GL_UPLOAD,GstGLUpload))
@@ -41,10 +36,6 @@ GType gst_gl_upload_get_type (void);
 #define GST_IS_GL_UPLOAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_GL_UPLOAD))
 #define GST_GL_UPLOAD_CAST(obj) ((GstGLUpload*)(obj))
 
-typedef struct _GstGLUpload GstGLUpload;
-typedef struct _GstGLUploadClass GstGLUploadClass;
-typedef struct _GstGLUploadPrivate GstGLUploadPrivate;
-
 /**
  * GstGLUpload
  * @parent: the parent object
index 76de438..c835b78 100644 (file)
@@ -25,9 +25,8 @@
 
 #include <gst/gst.h>
 
+#include "gl.h"
 #include "gstglutils.h"
-#include "gstglfeature.h"
-#include "gstglframebuffer.h"
 
 #ifndef GL_FRAMEBUFFER_UNDEFINED
 #define GL_FRAMEBUFFER_UNDEFINED          0x8219
index 2761a02..e22d5ce 100644 (file)
 #ifndef __GST_GL_UTILS_H__
 #define __GST_GL_UTILS_H__
 
-typedef struct _GstGLDisplay GstGLDisplay;
-typedef struct _GstGLShader GstGLShader;
-
 #include <gst/video/video.h>
 
-#include "gstgldisplay.h"
-#include "gstglshader.h"
+#include "gstgl_fwd.h"
 
 /**
  * GstGLDisplayProjection:
index 2cb74bd..1aa1b8c 100644 (file)
@@ -25,6 +25,7 @@
 #include <gmodule.h>
 #include <stdio.h>
 
+#include "gl.h"
 #include "gstglwindow.h"
 
 #if GST_GL_HAVE_WINDOW_X11
@@ -40,8 +41,6 @@
 #include "wayland/gstglwindow_wayland_egl.h"
 #endif
 
-#include "gstglfeature.h"
-
 #define USING_OPENGL(display) (display->gl_api & GST_GL_API_OPENGL)
 #define USING_OPENGL3(display) (display->gl_api & GST_GL_API_OPENGL3)
 #define USING_GLES(display) (display->gl_api & GST_GL_API_GLES)
index 923c927..f6f03b7 100644 (file)
 #ifndef __GST_GL_WINDOW_H__
 #define __GST_GL_WINDOW_H__
 
-typedef struct _GstGLDisplay GstGLDisplay;
-
 #include <gst/gst.h>
 
-#include "gstglapi.h"
-#include "gstgldisplay.h"
+#include "gstgl_fwd.h"
 
 G_BEGIN_DECLS
 
@@ -70,10 +67,6 @@ typedef void (*GstGLWindowResizeCB) (gpointer data, guint width, guint height);
 #define        GST_GL_WINDOW_CB(f)                      ((GstGLWindowCB) (f))
 #define        GST_GL_WINDOW_RESIZE_CB(f)               ((GstGLWindowResizeCB) (f))
 
-typedef struct _GstGLWindow        GstGLWindow;
-typedef struct _GstGLWindowPrivate GstGLWindowPrivate;
-typedef struct _GstGLWindowClass   GstGLWindowClass;
-
 struct _GstGLWindow {
   /*< private >*/
   GObject parent;