cogl: Don't undef __INSIDE_COGL_H__ in file not defining it

If you include a file that might define __INSIDE_COGL_H__, don't
undefine it if it wasn't defined in that file. This makes it possible
to include for example cogl-gles2.h from some other file which defines
__INSIDE_COGL_H__.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
This commit is contained in:
Jonas Ådahl 2016-05-05 15:16:01 +08:00
parent 90de521799
commit e2f5579391
6 changed files with 19 additions and 18 deletions

View File

@ -49,7 +49,7 @@
* __COGL_H_INSIDE__ */
#ifndef __COGL_H_INSIDE__
#define __COGL_H_INSIDE__
#define __COGL_MUST_UNDEF_COGL_H_INSIDE__
#define __COGL_MUST_UNDEF_COGL_H_INSIDE_COGL_EGL__
#endif
#endif /* COGL_COMPILATION */
@ -109,10 +109,10 @@ COGL_END_DECLS
* a commandline argument for the scanner which means we must be
* careful not to undefine it in a header...
*/
#ifdef __COGL_MUST_UNDEF_COGL_H_INSIDE__
#ifdef __COGL_MUST_UNDEF_COGL_H_INSIDE_COGL_EGL__
#undef __COGL_H_INSIDE__
#undef __COGL_EGL_H_INSIDE__
#undef __COGL_MUST_UNDEF_COGL_H_INSIDE__
#undef __COGL_MUST_UNDEF_COGL_H_INSIDE_COGL_EGL__
#endif
#endif /* __COGL_EGL_H__ */

View File

@ -47,7 +47,7 @@
* __COGL_H_INSIDE__ */
#ifndef __COGL_H_INSIDE__
#define __COGL_H_INSIDE__
#define __COGL_MUST_UNDEF_COGL_H_INSIDE__
#define __COGL_MUST_UNDEF_COGL_H_INSIDE_COGL_GLES2__
#endif
#endif /* COGL_COMPILATION */
@ -411,9 +411,9 @@ COGL_END_DECLS
* a commandline argument for the scanner which means we must be
* careful not to undefine it in a header...
*/
#ifdef __COGL_MUST_UNDEF_COGL_H_INSIDE__
#ifdef __COGL_MUST_UNDEF_COGL_H_INSIDE_COGL_GLES2__
#undef __COGL_H_INSIDE__
#undef __COGL_MUST_UNDEF_COGL_H_INSIDE__
#undef __COGL_MUST_UNDEF_COGL_H_INSIDE_COGL_GLES2__
#endif
#endif /* __COGL_GLES2_H__ */

View File

@ -49,7 +49,7 @@
* __COGL_H_INSIDE__ */
#ifndef __COGL_H_INSIDE__
#define __COGL_H_INSIDE__
#define __COGL_MUST_UNDEF_COGL_H_INSIDE__
#define __COGL_MUST_UNDEF_COGL_H_INSIDE_COGL_GLX_
#endif
#endif /* COGL_COMPILATION */
@ -86,10 +86,11 @@ COGL_END_DECLS
* a commandline argument for the scanner which means we must be
* careful not to undefine it in a header...
*/
#ifdef __COGL_MUST_UNDEF_COGL_H_INSIDE__
#ifdef __COGL_MUST_UNDEF_COGL_H_INSIDE_COGL_GLX_
#warning
#undef __COGL_H_INSIDE__
#undef __COGL_GLX_H_INSIDE__
#undef __COGL_MUST_UNDEF_COGL_H_INSIDE__
#undef __COGL_MUST_UNDEF_COGL_H_INSIDE_COGL_GLX_
#endif
#endif /* __COGL_GLX_H__ */

View File

@ -44,7 +44,7 @@
* __COGL_H_INSIDE__ */
#ifndef __COGL_H_INSIDE__
#define __COGL_H_INSIDE__
#define __COGL_MUST_UNDEF_COGL_H_INSIDE__
#define __COGL_MUST_UNDEF_COGL_H_INSIDE_COGL_WAYLAND_SERVER_
#endif
#endif /* COGL_COMPILATION */
@ -155,9 +155,9 @@ COGL_END_DECLS
* a commandline argument for the scanner which means we must be
* careful not to undefine it in a header...
*/
#ifdef __COGL_MUST_UNDEF_COGL_H_INSIDE__
#ifdef __COGL_MUST_UNDEF_COGL_H_INSIDE_COGL_WAYLAND_SERVER_
#undef __COGL_H_INSIDE__
#undef __COGL_MUST_UNDEF_COGL_H_INSIDE__
#undef __COGL_MUST_UNDEF_COGL_H_INSIDE_COGL_WAYLAND_SERVER_
#endif
#endif /* __COGL_WAYLAND_SERVER_H */

View File

@ -48,7 +48,7 @@
* __COGL_H_INSIDE__ */
#ifndef __COGL_H_INSIDE__
#define __COGL_H_INSIDE__
#define __COGL_XLIB_RENDERER_H_MUST_UNDEF_COGL_H_INSIDE__
#define __COGL_XLIB_RENDERER_H_MUST_UNDEF_COGL_H_INSIDE_COGL_XLIB_RENDERER_
#endif
#endif /* COGL_COMPILATION */
@ -224,9 +224,9 @@ COGL_END_DECLS
* a commandline argument for the scanner which means we must be
* careful not to undefine it in a header...
*/
#ifdef __COGL_XLIB_RENDERER_H_MUST_UNDEF_COGL_H_INSIDE__
#ifdef __COGL_XLIB_RENDERER_H_MUST_UNDEF_COGL_H_INSIDE_COGL_XLIB_RENDERER_
#undef __COGL_H_INSIDE__
#undef __COGL_XLIB_RENDERER_H_MUST_UNDEF_COGL_H_INSIDE__
#undef __COGL_XLIB_RENDERER_H_MUST_UNDEF_COGL_H_INSIDE_COGL_XLIB_RENDERER_
#endif
#endif /* __COGL_XLIB_RENDERER_H__ */

View File

@ -43,7 +43,7 @@
* __COGL_H_INSIDE__ */
#ifndef __COGL_H_INSIDE__
#define __COGL_H_INSIDE__
#define __COGL_MUST_UNDEF_COGL_H_INSIDE__
#define __COGL_MUST_UNDEF_COGL_H_INSIDE_COGL_TEXTURE_PIXMAP_X11_
#endif
#endif /* COGL_COMPILATION */
@ -286,9 +286,9 @@ COGL_END_DECLS
* a commandline argument for the scanner which means we must be
* careful not to undefine it in a header...
*/
#ifdef __COGL_MUST_UNDEF_COGL_H_INSIDE__
#ifdef __COGL_MUST_UNDEF_COGL_H_INSIDE_COGL_TEXTURE_PIXMAP_X11_
#undef __COGL_H_INSIDE__
#undef __COGL_MUST_UNDEF_COGL_H_INSIDE__
#undef __COGL_MUST_UNDEF_COGL_H_INSIDE_COGL_TEXTURE_PIXMAP_X11_
#endif
#endif /* __COGL_TEXTURE_PIXMAP_X11_H */