From a2f26a96dc6a09eaba796c89f3bd17b9e73848a4 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Wed, 18 Apr 2018 09:10:25 -0300 Subject: [PATCH] Add a macro to deprecate methods --- core/error_macros.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/error_macros.h b/core/error_macros.h index b8d0c7e0c37..168b2e06fe2 100644 --- a/core/error_macros.h +++ b/core/error_macros.h @@ -311,4 +311,14 @@ extern bool _err_error_exists; _err_error_exists = false; \ } +#define WARN_DEPRECATED \ + { \ + static bool warning_shown=false;\ + if (!warning_shown) {\ + _err_print_error(FUNCTION_STR, __FILE__, __LINE__,"This method has been deprecated and will be removed in the future", ERR_HANDLER_WARNING); \ + _err_error_exists = false; \ + warning_shown=true;\ + }\ + } + #endif