Skip to content

Commit

Permalink
[732/906] build: fix repeated typedefs
Browse files Browse the repository at this point in the history
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
  • Loading branch information
CapOM authored and tp-m committed Dec 9, 2017
1 parent d4a8451 commit d17a438
Show file tree
Hide file tree
Showing 28 changed files with 129 additions and 81 deletions.
6 changes: 4 additions & 2 deletions gst-libs/gst/gl/Makefile.am
Expand Up @@ -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) \
Expand Down
41 changes: 41 additions & 0 deletions gst-libs/gst/gl/gl.h
@@ -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__ */
56 changes: 56 additions & 0 deletions gst-libs/gst/gl/gstgl_fwd.h
@@ -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__ */
5 changes: 3 additions & 2 deletions gst-libs/gst/gl/gstglapi.h
Expand Up @@ -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>
Expand All @@ -52,10 +53,10 @@
#define GSTGLAPI
#endif

#include "glprototypes/gstgl_compat.h"

#include <gst/gst.h>

#include "glprototypes/gstgl_compat.h"

G_BEGIN_DECLS

typedef enum {
Expand Down
1 change: 1 addition & 0 deletions gst-libs/gst/gl/gstglbufferpool.c
Expand Up @@ -22,6 +22,7 @@
#include "config.h"
#endif

#include "gl.h"
#include "gstglbufferpool.h"

/**
Expand Down
3 changes: 1 addition & 2 deletions gst-libs/gst/gl/gstglbufferpool.h
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions gst-libs/gst/gl/gstgldisplay.c
Expand Up @@ -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);
Expand Down
11 changes: 1 addition & 10 deletions gst-libs/gst/gl/gstgldisplay.h
Expand Up @@ -24,12 +24,7 @@
#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

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion gst-libs/gst/gl/gstgldownload.c
Expand Up @@ -24,8 +24,8 @@

#include <stdio.h>

#include "gl.h"
#include "gstgldownload.h"
#include "gstglmemory.h"

/**
* SECTION:gstgldownload
Expand Down
11 changes: 1 addition & 10 deletions gst-libs/gst/gl/gstgldownload.h
Expand Up @@ -24,15 +24,10 @@
#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))
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions gst-libs/gst/gl/gstglegl.c
Expand Up @@ -22,6 +22,7 @@
#include "config.h"
#endif

#include "gl.h"
#include "gstglegl.h"

static const gchar *
Expand Down
2 changes: 1 addition & 1 deletion gst-libs/gst/gl/gstglegl.h
Expand Up @@ -24,7 +24,7 @@
#include <gst/gst.h>
#include <EGL/egl.h>

#include "gstglwindow.h"
#include "gstgl_fwd.h"

G_BEGIN_DECLS

Expand Down
3 changes: 1 addition & 2 deletions gst-libs/gst/gl/gstglfeature.c
Expand Up @@ -24,10 +24,9 @@

#include <string.h>

#include "gl.h"
#include "gstglfeature.h"

#include "gstglapi.h"

gboolean
gst_gl_check_extension (const char *name, const gchar * ext)
{
Expand Down
2 changes: 1 addition & 1 deletion gst-libs/gst/gl/gstglfeature.h
Expand Up @@ -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) \
Expand Down
2 changes: 1 addition & 1 deletion gst-libs/gst/gl/gstglfilter.h
Expand Up @@ -27,7 +27,7 @@
#include <gst/base/gstbasetransform.h>
#include <gst/video/video.h>

#include "gstglbufferpool.h"
#include "gl.h"

G_BEGIN_DECLS

Expand Down
1 change: 1 addition & 0 deletions gst-libs/gst/gl/gstglframebuffer.c
Expand Up @@ -21,6 +21,7 @@
#include "config.h"
#endif

#include "gl.h"
#include "gstglframebuffer.h"

GST_DEBUG_CATEGORY_STATIC (gst_gl_framebuffer_debug);
Expand Down
2 changes: 1 addition & 1 deletion gst-libs/gst/gl/gstglframebuffer.h
Expand Up @@ -21,7 +21,7 @@
#ifndef __GST_GL_FRAMEBUFFER_H__
#define __GST_GL_FRAMEBUFFER_H__

#include "gstgldisplay.h"
#include "gstgl_fwd.h"

G_BEGIN_DECLS

Expand Down
1 change: 0 additions & 1 deletion gst-libs/gst/gl/gstglmemory.c
Expand Up @@ -25,7 +25,6 @@
#include <gst/video/video.h>

#include "gstglmemory.h"
#include "gstglutils.h"

/**
* SECTION:gstglmemory
Expand Down
11 changes: 3 additions & 8 deletions gst-libs/gst/gl/gstglmemory.h
Expand Up @@ -22,12 +22,11 @@
#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

Expand All @@ -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:
*
Expand Down
2 changes: 1 addition & 1 deletion gst-libs/gst/gl/gstglmixer.h
Expand Up @@ -25,7 +25,7 @@
#include <gst/video/video.h>
#include "gstglmixerpad.h"

#include "gstglbufferpool.h"
#include "gl.h"

G_BEGIN_DECLS

Expand Down
1 change: 1 addition & 0 deletions gst-libs/gst/gl/gstglshader.c
Expand Up @@ -22,6 +22,7 @@
#include "config.h"
#endif

#include "gl.h"
#include "gstglshader.h"

#ifndef GL_COMPILE_STATUS
Expand Down
9 changes: 1 addition & 8 deletions gst-libs/gst/gl/gstglshader.h
Expand Up @@ -21,13 +21,10 @@
#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))
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion gst-libs/gst/gl/gstglupload.c
Expand Up @@ -24,8 +24,8 @@

#include <stdio.h>

#include "gl.h"
#include "gstglupload.h"
#include "gstglmemory.h"

/**
* SECTION:gstglupload
Expand Down

0 comments on commit d17a438

Please sign in to comment.