From a0ea2f3aca41e6e59ab2000544c04d5950b4dce9 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Wed, 3 Jul 2013 17:06:23 +0100 Subject: [PATCH] Don't enable deprecation warnings for internal API when building Cogl The 1.x branch needs to use some of the deprecated API internally in order to set up some deprecated state. This was causing a lot of annoying warnings so instead we'll just disable the deprecation attribute when COGL_COMPLIATION is defined. It probably wouldn't be a good idea to apply this to the 2.0 branch because at least for now we want to get warnings if we accidentally use deprecated API internally. Reviewed-by: Robert Bragg --- cogl/cogl-macros.h | 2 +- cogl/cogl-types.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cogl/cogl-macros.h b/cogl/cogl-macros.h index be072c96a..a30cb9044 100644 --- a/cogl/cogl-macros.h +++ b/cogl/cogl-macros.h @@ -35,7 +35,7 @@ * They are only intended for internal use and should not be used by * other projects. */ -#ifdef COGL_DISABLE_DEPRECATION_WARNINGS +#if defined(COGL_DISABLE_DEPRECATION_WARNINGS) || defined(COGL_COMPILATION) #define COGL_DEPRECATED #define COGL_DEPRECATED_FOR(f) diff --git a/cogl/cogl-types.h b/cogl/cogl-types.h index 227b7ec8f..57e0e29db 100644 --- a/cogl/cogl-types.h +++ b/cogl/cogl-types.h @@ -99,7 +99,8 @@ typedef int CoglBool; #define COGL_GNUC_NULL_TERMINATED #endif -#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) +#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) && \ + !defined (COGL_COMPILATION) #define COGL_GNUC_DEPRECATED \ __attribute__((__deprecated__)) #else