From b0e5becfb9d67c1aa2feec37fda2194d596a53e8 Mon Sep 17 00:00:00 2001 From: Snaipe Date: Sat, 25 Apr 2015 17:04:47 +0200 Subject: [PATCH] Added better deprecation message --- include/criterion/assert.h | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/include/criterion/assert.h b/include/criterion/assert.h index 62378dc..aa16018 100644 --- a/include/criterion/assert.h +++ b/include/criterion/assert.h @@ -273,17 +273,14 @@ struct criterion_assert_args { // It shall be removed in the text major version of Criterion # ifndef CRITERION_NO_COMPAT -/* -# define CRITERION_ASSERT_DEPRECATED_(Name) \ - _Pragma("message \"" \ - "The " #Name " macro is deprecated, " \ - "please use cr_" #Name " instead." \ - "\"" \ +# define CRITERION_ASSERT_DEPRECATED_(Name) CRITERION_ASSERT_DEPRECATED__( \ + message \ + "The `" #Name "` macro is deprecated, " \ + "please use `cr_" #Name "` instead." \ ) - */ -# define CRITERION_ASSERT_DEPRECATED_(Name) \ - _Pragma("message \"This macro is deprecated, please use its `cr_`-prefixed alternative instead.\"") +# define CRITERION_ASSERT_DEPRECATED__(Msg) \ + _Pragma(#Msg) # ifndef assert # define assert(...) CRITERION_ASSERT_DEPRECATED_(assert) cr_assert(__VA_ARGS__)