From e3aea910b1524933e6ea3ef95a19a6c970d46677 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 7 Mar 2012 12:04:44 +0000 Subject: [PATCH] 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 file changed, 7 insertions(+), 2 deletions(-) diff --git a/clutter/clutter-profile.h b/clutter/clutter-profile.h index 73925145c..bb78afa63 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