[732/906] 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
This commit is contained in:
Julien Isorce 2013-07-10 16:03:04 +01:00 committed by Matthew Waters
parent 3c0b9715a9
commit dd7e054e2c
30 changed files with 131 additions and 84 deletions

View file

@ -81,7 +81,9 @@ libgstgl_@GST_API_VERSION@include_HEADERS = \
gstglapi.h \ gstglapi.h \
gstglfeature.h \ gstglfeature.h \
gstglutils.h \ gstglutils.h \
gstglframebuffer.h gstglframebuffer.h \
gstgl_fwd.h \
gl.h
libgstgl_@GST_API_VERSION@_la_CFLAGS = \ libgstgl_@GST_API_VERSION@_la_CFLAGS = \
$(GL_CFLAGS) \ $(GL_CFLAGS) \

41
gst-libs/gst/gl/gl.h Normal file
View file

@ -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__ */

View file

@ -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__ */

View file

@ -37,6 +37,7 @@
# if __APPLE__ # if __APPLE__
# include <OpenGL/OpenGL.h> # include <OpenGL/OpenGL.h>
# include <OpenGL/gl.h> # include <OpenGL/gl.h>
# include <OpenGL/glu.h>
# else # else
# include <GL/glu.h> # include <GL/glu.h>
# include <GL/gl.h> # include <GL/gl.h>
@ -52,10 +53,10 @@
#define GSTGLAPI #define GSTGLAPI
#endif #endif
#include "glprototypes/gstgl_compat.h"
#include <gst/gst.h> #include <gst/gst.h>
#include "glprototypes/gstgl_compat.h"
G_BEGIN_DECLS G_BEGIN_DECLS
typedef enum { typedef enum {

View file

@ -22,6 +22,7 @@
#include "config.h" #include "config.h"
#endif #endif
#include "gl.h"
#include "gstglbufferpool.h" #include "gstglbufferpool.h"
/** /**

View file

@ -25,8 +25,7 @@
#include <gst/video/gstvideometa.h> #include <gst/video/gstvideometa.h>
#include <gst/video/gstvideopool.h> #include <gst/video/gstvideopool.h>
#include "gstgldisplay.h" #include "gstgl_fwd.h"
#include "gstglmemory.h"
G_BEGIN_DECLS G_BEGIN_DECLS

View file

@ -25,8 +25,7 @@
#include "config.h" #include "config.h"
#endif #endif
#include "gstglmemory.h" #include "gl.h"
#include "gstgldisplay.h" #include "gstgldisplay.h"
GST_DEBUG_CATEGORY_STATIC (gst_gl_display_debug); GST_DEBUG_CATEGORY_STATIC (gst_gl_display_debug);

View file

@ -24,12 +24,7 @@
#ifndef __GST_GL_DISPLAY_H__ #ifndef __GST_GL_DISPLAY_H__
#define __GST_GL_DISPLAY_H__ #define __GST_GL_DISPLAY_H__
#include "gstglconfig.h" #include "gstgl_fwd.h"
typedef struct _GstGLWindow GstGLWindow;
#include "gstglwindow.h"
#include "gstglutils.h"
G_BEGIN_DECLS 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_IS_GL_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_GL_DISPLAY))
#define GST_GL_DISPLAY_CAST(obj) ((GstGLDisplay*)(obj)) #define GST_GL_DISPLAY_CAST(obj) ((GstGLDisplay*)(obj))
typedef struct _GstGLDisplay GstGLDisplay;
typedef struct _GstGLDisplayClass GstGLDisplayClass;
typedef struct _GstGLDisplayPrivate GstGLDisplayPrivate;
/** /**
* GstGLDisplayThreadFunc: * GstGLDisplayThreadFunc:
* @display: a #GstGLDisplay * @display: a #GstGLDisplay

View file

@ -24,8 +24,8 @@
#include <stdio.h> #include <stdio.h>
#include "gl.h"
#include "gstgldownload.h" #include "gstgldownload.h"
#include "gstglmemory.h"
/** /**
* SECTION:gstgldownload * SECTION:gstgldownload

View file

@ -24,15 +24,10 @@
#include <gst/video/video.h> #include <gst/video/video.h>
#include <gst/gstmemory.h> #include <gst/gstmemory.h>
#include "gstgldisplay.h" #include "gstgl_fwd.h"
#include "gstglshader.h"
G_BEGIN_DECLS G_BEGIN_DECLS
/* forward declare */
typedef struct _GstGLMemory GstGLMemory;
typedef struct _GstGLDisplay GstGLDisplay;
GType gst_gl_download_get_type (void); GType gst_gl_download_get_type (void);
#define GST_TYPE_GL_DOWNLOAD (gst_gl_download_get_type()) #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)) #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_IS_GL_DOWNLOAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_GL_DOWNLOAD))
#define GST_GL_DOWNLOAD_CAST(obj) ((GstGLDownload*)(obj)) #define GST_GL_DOWNLOAD_CAST(obj) ((GstGLDownload*)(obj))
typedef struct _GstGLDownload GstGLDownload;
typedef struct _GstGLDownloadClass GstGLDownloadClass;
typedef struct _GstGLDownloadPrivate GstGLDownloadPrivate;
/** /**
* GstGLDownload * GstGLDownload
* @parent: the parent object * @parent: the parent object

View file

@ -22,6 +22,7 @@
#include "config.h" #include "config.h"
#endif #endif
#include "gl.h"
#include "gstglegl.h" #include "gstglegl.h"
static const gchar * static const gchar *

View file

@ -24,7 +24,7 @@
#include <gst/gst.h> #include <gst/gst.h>
#include <EGL/egl.h> #include <EGL/egl.h>
#include "gstglwindow.h" #include "gstgl_fwd.h"
G_BEGIN_DECLS G_BEGIN_DECLS

View file

@ -24,10 +24,9 @@
#include <string.h> #include <string.h>
#include "gl.h"
#include "gstglfeature.h" #include "gstglfeature.h"
#include "gstglapi.h"
gboolean gboolean
gst_gl_check_extension (const char *name, const gchar * ext) gst_gl_check_extension (const char *name, const gchar * ext)
{ {

View file

@ -45,7 +45,7 @@
#include <gst/gst.h> #include <gst/gst.h>
#include "gstgldisplay.h" #include "gstgl_fwd.h"
#define GST_GL_CHECK_GL_VERSION(driver_major, driver_minor, \ #define GST_GL_CHECK_GL_VERSION(driver_major, driver_minor, \
target_major, target_minor) \ target_major, target_minor) \

View file

@ -27,7 +27,7 @@
#include <gst/base/gstbasetransform.h> #include <gst/base/gstbasetransform.h>
#include <gst/video/video.h> #include <gst/video/video.h>
#include "gstglbufferpool.h" #include "gl.h"
G_BEGIN_DECLS G_BEGIN_DECLS

View file

@ -21,6 +21,7 @@
#include "config.h" #include "config.h"
#endif #endif
#include "gl.h"
#include "gstglframebuffer.h" #include "gstglframebuffer.h"
GST_DEBUG_CATEGORY_STATIC (gst_gl_framebuffer_debug); GST_DEBUG_CATEGORY_STATIC (gst_gl_framebuffer_debug);

View file

@ -21,7 +21,7 @@
#ifndef __GST_GL_FRAMEBUFFER_H__ #ifndef __GST_GL_FRAMEBUFFER_H__
#define __GST_GL_FRAMEBUFFER_H__ #define __GST_GL_FRAMEBUFFER_H__
#include "gstgldisplay.h" #include "gstgl_fwd.h"
G_BEGIN_DECLS G_BEGIN_DECLS

View file

@ -25,7 +25,6 @@
#include <gst/video/video.h> #include <gst/video/video.h>
#include "gstglmemory.h" #include "gstglmemory.h"
#include "gstglutils.h"
/** /**
* SECTION:gstglmemory * SECTION:gstglmemory

View file

@ -22,12 +22,11 @@
#define _GST_GL_MEMORY_H_ #define _GST_GL_MEMORY_H_
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/gstmemory.h>
#include <gst/gstallocator.h> #include <gst/gstallocator.h>
#include <gst/gstmemory.h>
#include <gst/video/video.h>
#include "gstgldisplay.h" #include "gl.h"
#include "gstgldownload.h"
#include "gstglupload.h"
G_BEGIN_DECLS 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_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_GL_ALLOCATOR, GstGLAllocatorClass))
#define GST_GL_ALLOCATOR_CAST(obj) ((GstGLAllocator *)(obj)) #define GST_GL_ALLOCATOR_CAST(obj) ((GstGLAllocator *)(obj))
typedef struct _GstGLMemory GstGLMemory;
typedef struct _GstGLAllocator GstGLAllocator;
typedef struct _GstGLAllocatorClass GstGLAllocatorClass;
/** /**
* GstGLMemoryFlags: * GstGLMemoryFlags:
* *

View file

@ -25,7 +25,7 @@
#include <gst/video/video.h> #include <gst/video/video.h>
#include "gstglmixerpad.h" #include "gstglmixerpad.h"
#include "gstglbufferpool.h" #include "gl.h"
G_BEGIN_DECLS G_BEGIN_DECLS

View file

@ -22,6 +22,7 @@
#include "config.h" #include "config.h"
#endif #endif
#include "gl.h"
#include "gstglshader.h" #include "gstglshader.h"
#ifndef GL_COMPILE_STATUS #ifndef GL_COMPILE_STATUS

View file

@ -21,13 +21,10 @@
#ifndef __GST_GL_SHADER_H__ #ifndef __GST_GL_SHADER_H__
#define __GST_GL_SHADER_H__ #define __GST_GL_SHADER_H__
#include "gstgldisplay.h" #include "gstgl_fwd.h"
#include <gst/gst.h>
G_BEGIN_DECLS G_BEGIN_DECLS
typedef struct _GstGLDisplay GstGLDisplay;
#define GST_GL_TYPE_SHADER (gst_gl_shader_get_type()) #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(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)) #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 GST_GL_SHADER_VERTEX_SOURCE
} GstGLShaderSourceType; } GstGLShaderSourceType;
typedef struct _GstGLShader GstGLShader;
typedef struct _GstGLShaderPrivate GstGLShaderPrivate;
typedef struct _GstGLShaderClass GstGLShaderClass;
struct _GstGLShader { struct _GstGLShader {
/*< private >*/ /*< private >*/
GObject parent; GObject parent;

View file

@ -24,8 +24,8 @@
#include <stdio.h> #include <stdio.h>
#include "gl.h"
#include "gstglupload.h" #include "gstglupload.h"
#include "gstglmemory.h"
/** /**
* SECTION:gstglupload * SECTION:gstglupload

View file

@ -24,15 +24,10 @@
#include <gst/video/video.h> #include <gst/video/video.h>
#include <gst/gstmemory.h> #include <gst/gstmemory.h>
#include "gstglshader.h" #include "gstgl_fwd.h"
#include "gstgldisplay.h"
G_BEGIN_DECLS G_BEGIN_DECLS
/* forward declare */
typedef struct _GstGLMemory GstGLMemory;
typedef struct _GstGLDisplay GstGLDisplay;
GType gst_gl_upload_get_type (void); GType gst_gl_upload_get_type (void);
#define GST_TYPE_GL_UPLOAD (gst_gl_upload_get_type()) #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)) #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_IS_GL_UPLOAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_GL_UPLOAD))
#define GST_GL_UPLOAD_CAST(obj) ((GstGLUpload*)(obj)) #define GST_GL_UPLOAD_CAST(obj) ((GstGLUpload*)(obj))
typedef struct _GstGLUpload GstGLUpload;
typedef struct _GstGLUploadClass GstGLUploadClass;
typedef struct _GstGLUploadPrivate GstGLUploadPrivate;
/** /**
* GstGLUpload * GstGLUpload
* @parent: the parent object * @parent: the parent object

View file

@ -25,9 +25,8 @@
#include <gst/gst.h> #include <gst/gst.h>
#include "gl.h"
#include "gstglutils.h" #include "gstglutils.h"
#include "gstglfeature.h"
#include "gstglframebuffer.h"
#ifndef GL_FRAMEBUFFER_UNDEFINED #ifndef GL_FRAMEBUFFER_UNDEFINED
#define GL_FRAMEBUFFER_UNDEFINED 0x8219 #define GL_FRAMEBUFFER_UNDEFINED 0x8219

View file

@ -21,13 +21,9 @@
#ifndef __GST_GL_UTILS_H__ #ifndef __GST_GL_UTILS_H__
#define __GST_GL_UTILS_H__ #define __GST_GL_UTILS_H__
typedef struct _GstGLDisplay GstGLDisplay;
typedef struct _GstGLShader GstGLShader;
#include <gst/video/video.h> #include <gst/video/video.h>
#include "gstgldisplay.h" #include "gstgl_fwd.h"
#include "gstglshader.h"
/** /**
* GstGLDisplayProjection: * GstGLDisplayProjection:

View file

@ -25,6 +25,7 @@
#include <gmodule.h> #include <gmodule.h>
#include <stdio.h> #include <stdio.h>
#include "gl.h"
#include "gstglwindow.h" #include "gstglwindow.h"
#if GST_GL_HAVE_WINDOW_X11 #if GST_GL_HAVE_WINDOW_X11
@ -40,8 +41,6 @@
#include "wayland/gstglwindow_wayland_egl.h" #include "wayland/gstglwindow_wayland_egl.h"
#endif #endif
#include "gstglfeature.h"
#define USING_OPENGL(display) (display->gl_api & GST_GL_API_OPENGL) #define USING_OPENGL(display) (display->gl_api & GST_GL_API_OPENGL)
#define USING_OPENGL3(display) (display->gl_api & GST_GL_API_OPENGL3) #define USING_OPENGL3(display) (display->gl_api & GST_GL_API_OPENGL3)
#define USING_GLES(display) (display->gl_api & GST_GL_API_GLES) #define USING_GLES(display) (display->gl_api & GST_GL_API_GLES)

View file

@ -22,12 +22,9 @@
#ifndef __GST_GL_WINDOW_H__ #ifndef __GST_GL_WINDOW_H__
#define __GST_GL_WINDOW_H__ #define __GST_GL_WINDOW_H__
typedef struct _GstGLDisplay GstGLDisplay;
#include <gst/gst.h> #include <gst/gst.h>
#include "gstglapi.h" #include "gstgl_fwd.h"
#include "gstgldisplay.h"
G_BEGIN_DECLS 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_CB(f) ((GstGLWindowCB) (f))
#define GST_GL_WINDOW_RESIZE_CB(f) ((GstGLWindowResizeCB) (f)) #define GST_GL_WINDOW_RESIZE_CB(f) ((GstGLWindowResizeCB) (f))
typedef struct _GstGLWindow GstGLWindow;
typedef struct _GstGLWindowPrivate GstGLWindowPrivate;
typedef struct _GstGLWindowClass GstGLWindowClass;
struct _GstGLWindow { struct _GstGLWindow {
/*< private >*/ /*< private >*/
GObject parent; GObject parent;

View file

@ -27,8 +27,7 @@
#include <gst/video/gstvideosink.h> #include <gst/video/gstvideosink.h>
#include <gst/video/video.h> #include <gst/video/video.h>
#include "gstglbufferpool.h" #include "gl.h"
#include <gst/gl/gstglconfig.h>
G_BEGIN_DECLS G_BEGIN_DECLS

View file

@ -26,7 +26,7 @@
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/base/gstpushsrc.h> #include <gst/base/gstpushsrc.h>
#include "gstglbufferpool.h" #include "gl.h"
G_BEGIN_DECLS G_BEGIN_DECLS