[clutter] Try to avoid duplicate declarations for profile macros



commit e3aea910b1524933e6ea3ef95a19a6c970d46677
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Wed Mar 7 12:04:44 2012 +0000

    Try to avoid duplicate declarations for profile macros
    
    We can use the __COUNTER__ macro or, failing that, the __LINE__ macro to
    ensure that we don't declare dummy variables more than once with the
    same name.

 clutter/clutter-profile.h |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/clutter/clutter-profile.h b/clutter/clutter-profile.h
index 7392514..bb78afa 100644
--- a/clutter/clutter-profile.h
+++ b/clutter/clutter-profile.h
@@ -51,8 +51,13 @@ void    _clutter_profile_resume         (void);
 
 #else /* CLUTTER_ENABLE_PROFILE */
 
-#define CLUTTER_STATIC_TIMER(A,B,C,D,E) extern void _clutter_dummy_decl (void)
-#define CLUTTER_STATIC_COUNTER(A,B,C,D) extern void _clutter_dummy_decl (void)
+#ifdef __COUNTER__
+#define CLUTTER_STATIC_TIMER(A,B,C,D,E) extern void G_PASTE (_clutter_dummy_decl, __COUNTER__) (void)
+#define CLUTTER_STATIC_COUNTER(A,B,C,D) extern void G_PASTE (_clutter_dummy_decl, __COUNTER__) (void)
+#else
+#define CLUTTER_STATIC_TIMER(A,B,C,D,E) extern void G_PASTE (_clutter_dummy_decl, __LINE__) (void)
+#define CLUTTER_STATIC_TIMER(A,B,C,D,E) extern void G_PASTE (_clutter_dummy_decl, __LINE__) (void)
+#endif
 #define CLUTTER_COUNTER_INC(A,B)        G_STMT_START { } G_STMT_END
 #define CLUTTER_COUNTER_DEC(A,B)        G_STMT_START { } G_STMT_END
 #define CLUTTER_TIMER_START(A,B)        G_STMT_START { } G_STMT_END



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]