[Cogl] [PATCH 1/3] Don't enable deprecation warnings for internal API when building Cogl

Neil Roberts neil at linux.intel.com
Wed Jul 3 09:51:53 PDT 2013


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.
---
 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 be072c9..a30cb90 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 227b7ec..57e0e29 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
-- 
1.7.11.3.g3c3efa5



More information about the Cogl mailing list