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 <robert@linux.intel.com>
This commit is contained in:
Neil Roberts 2013-07-03 17:06:23 +01:00
parent c2964723f8
commit a0ea2f3aca
2 changed files with 3 additions and 2 deletions

View File

@ -35,7 +35,7 @@
* They are only intended for internal use and should not be used by * They are only intended for internal use and should not be used by
* other projects. * other projects.
*/ */
#ifdef COGL_DISABLE_DEPRECATION_WARNINGS #if defined(COGL_DISABLE_DEPRECATION_WARNINGS) || defined(COGL_COMPILATION)
#define COGL_DEPRECATED #define COGL_DEPRECATED
#define COGL_DEPRECATED_FOR(f) #define COGL_DEPRECATED_FOR(f)

View File

@ -99,7 +99,8 @@ typedef int CoglBool;
#define COGL_GNUC_NULL_TERMINATED #define COGL_GNUC_NULL_TERMINATED
#endif #endif
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) #if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) && \
!defined (COGL_COMPILATION)
#define COGL_GNUC_DEPRECATED \ #define COGL_GNUC_DEPRECATED \
__attribute__((__deprecated__)) __attribute__((__deprecated__))
#else #else