From d99486096bcb8e4dd7062f786735b54b1a158067 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Mon, 2 Sep 2019 15:58:16 +0200 Subject: [PATCH] Added deprecation macro. --- include/freerdp/settings.h | 20 ++++++++++---------- winpr/include/winpr/winpr.h | 8 ++++++++ winpr/include/winpr/wlog.h | 4 ++-- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/include/freerdp/settings.h b/include/freerdp/settings.h index 553f7eb1f..7a89c2000 100644 --- a/include/freerdp/settings.h +++ b/include/freerdp/settings.h @@ -1599,20 +1599,20 @@ FREERDP_API void freerdp_update_gateway_usage_method(rdpSettings* settings, UINT * the functions freerdp_get_param_* and freerdp_set_param_* are deprecated. * use freerdp_settings_get_* and freerdp_settings_set_* as a replacement! */ -FREERDP_API BOOL freerdp_get_param_bool(rdpSettings* settings, int id); -FREERDP_API int freerdp_set_param_bool(rdpSettings* settings, int id, BOOL param); +FREERDP_API WINPR_DEPRECATED(BOOL freerdp_get_param_bool(rdpSettings* settings, int id)); +FREERDP_API WINPR_DEPRECATED(int freerdp_set_param_bool(rdpSettings* settings, int id, BOOL param)); -FREERDP_API int freerdp_get_param_int(rdpSettings* settings, int id); -FREERDP_API int freerdp_set_param_int(rdpSettings* settings, int id, int param); +FREERDP_API WINPR_DEPRECATED(int freerdp_get_param_int(rdpSettings* settings, int id)); +FREERDP_API WINPR_DEPRECATED(int freerdp_set_param_int(rdpSettings* settings, int id, int param)); -FREERDP_API UINT32 freerdp_get_param_uint32(rdpSettings* settings, int id); -FREERDP_API int freerdp_set_param_uint32(rdpSettings* settings, int id, UINT32 param); +FREERDP_API WINPR_DEPRECATED(UINT32 freerdp_get_param_uint32(rdpSettings* settings, int id)); +FREERDP_API WINPR_DEPRECATED(int freerdp_set_param_uint32(rdpSettings* settings, int id, UINT32 param)); -FREERDP_API UINT64 freerdp_get_param_uint64(rdpSettings* settings, int id); -FREERDP_API int freerdp_set_param_uint64(rdpSettings* settings, int id, UINT64 param); +FREERDP_API WINPR_DEPRECATED(UINT64 freerdp_get_param_uint64(rdpSettings* settings, int id)); +FREERDP_API WINPR_DEPRECATED(int freerdp_set_param_uint64(rdpSettings* settings, int id, UINT64 param)); -FREERDP_API char* freerdp_get_param_string(rdpSettings* settings, int id); -FREERDP_API int freerdp_set_param_string(rdpSettings* settings, int id, const char* param); +FREERDP_API WINPR_DEPRECATED(char* freerdp_get_param_string(rdpSettings* settings, int id)); +FREERDP_API WINPR_DEPRECATED(int freerdp_set_param_string(rdpSettings* settings, int id, const char* param)); FREERDP_API BOOL freerdp_settings_get_bool(rdpSettings* settings, size_t id); FREERDP_API BOOL freerdp_settings_set_bool(rdpSettings* settings, size_t id, BOOL param); diff --git a/winpr/include/winpr/winpr.h b/winpr/include/winpr/winpr.h index a2da2001d..c98214770 100644 --- a/winpr/include/winpr/winpr.h +++ b/winpr/include/winpr/winpr.h @@ -47,6 +47,14 @@ #define WINPR_API #endif +#if defined(WIN32) && !defined(__CYGWIN__) +#define WINPR_DEPRECATED(obj) __declspec(deprecated) obj +#elif defined(__GNUC__) +#define WINPR_DEPRECATED(obj) obj __attribute__ ((deprecated)) +#else +#define WINPR_DEPRECATED(obj) obj +#endif + /* Thread local storage keyword define */ #if defined _WIN32 || defined __CYGWIN__ #ifdef __GNUC__ diff --git a/winpr/include/winpr/wlog.h b/winpr/include/winpr/wlog.h index d81d9f53c..1acb9e7f6 100644 --- a/winpr/include/winpr/wlog.h +++ b/winpr/include/winpr/wlog.h @@ -180,9 +180,9 @@ WINPR_API wLog* WLog_GetRoot(void); WINPR_API wLog* WLog_Get(LPCSTR name); /** Deprecated */ -WINPR_API BOOL WLog_Init(void); +WINPR_API WINPR_DEPRECATED(BOOL WLog_Init(void)); /** Deprecated */ -WINPR_API BOOL WLog_Uninit(void); +WINPR_API WINPR_DEPRECATED(BOOL WLog_Uninit(void)); typedef BOOL (*wLogCallbackMessage_t)(const wLogMessage* msg); typedef BOOL (*wLogCallbackData_t)(const wLogMessage* msg);