From: Martin Quinson Date: Thu, 13 Jul 2017 16:04:45 +0000 (+0200) Subject: Improve deprecate messages: we know when to remove it X-Git-Tag: v3_17~397 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/c0cb7b3685313462f64f9330c7b226c4b6d7c0e3 Improve deprecate messages: we know when to remove it --- diff --git a/include/simgrid/msg.h b/include/simgrid/msg.h index 3991f2b93c..d143c3f61c 100644 --- a/include/simgrid/msg.h +++ b/include/simgrid/msg.h @@ -170,34 +170,48 @@ XBT_PUBLIC(void) MSG_zone_set_property_value(msg_netzone_t netzone, const char* XBT_PUBLIC(void) MSG_zone_get_hosts(msg_netzone_t zone, xbt_dynar_t whereto); /* Deprecated forms of the previous functions */ -static inline XBT_ATTRIB_DEPRECATED("Please use MSG_zone_get_root since v3.16") - msg_netzone_t MSG_environment_get_routing_root() { +static inline XBT_ATTRIB_DEPRECATED_v319( + "Use MSG_zone_get_root() instead: v3.19 will remove MSG_environment_get_routing_root() completely.") msg_netzone_t + MSG_environment_get_routing_root() +{ return MSG_zone_get_root(); } -static inline XBT_ATTRIB_DEPRECATED("Please use MSG_zone_get_name since v3.16") - const char* MSG_environment_as_get_name(msg_netzone_t zone) { +static inline XBT_ATTRIB_DEPRECATED_v319( + "Use MSG_zone_get_name() instead: v3.19 will remove MSG_environment_as_get_name() completely.") const + char* MSG_environment_as_get_name(msg_netzone_t zone) +{ return MSG_zone_get_name(zone); } -static inline XBT_ATTRIB_DEPRECATED("Please use MSG_zone_get_by_name since v3.16") - msg_netzone_t MSG_environment_as_get_by_name(const char* name) { +static inline XBT_ATTRIB_DEPRECATED_v319( + "Use MSG_zone_get_by_name() instead: v3.19 will remove MSG_environment_as_get_by_name() completely.") msg_netzone_t + MSG_environment_as_get_by_name(const char* name) +{ return MSG_zone_get_by_name(name); } -static inline XBT_ATTRIB_DEPRECATED("Please use MSG_zone_get_sons since v3.16") - xbt_dict_t MSG_environment_as_get_routing_sons(msg_netzone_t zone) { +static inline XBT_ATTRIB_DEPRECATED_v319( + "Use MSG_zone_get_sons() instead: v3.19 will remove MSG_environment_as_get_routing_sons() completely.") xbt_dict_t + MSG_environment_as_get_routing_sons(msg_netzone_t zone) +{ xbt_dict_t res = xbt_dict_new_homogeneous(NULL); MSG_zone_get_sons(zone, res); return res; } -static inline XBT_ATTRIB_DEPRECATED("Please use MSG_zone_get_property_value since v3.16") - const char* MSG_environment_as_get_property_value(msg_netzone_t zone, const char* name) { +static inline XBT_ATTRIB_DEPRECATED_v319( + "Use MSG_zone_get_property_value() instead: v3.19 will remove MSG_environment_as_get_property_value() completely.") + const char* MSG_environment_as_get_property_value(msg_netzone_t zone, const char* name) +{ return MSG_zone_get_property_value(zone, name); } -static inline XBT_ATTRIB_DEPRECATED("Please use MSG_zone_set_property_value since v3.16") - void MSG_environment_as_set_property_value(msg_netzone_t zone, const char* name, char* value) { +static inline XBT_ATTRIB_DEPRECATED_v319( + "Use MSG_zone_set_property_value() instead: v3.19 will remove MSG_environment_as_set_property_value() " + "completely.") void MSG_environment_as_set_property_value(msg_netzone_t zone, const char* name, char* value) +{ MSG_zone_set_property_value(zone, name, value); } -static inline XBT_ATTRIB_DEPRECATED("Please use MSG_zone_get_hosts since v3.16") - xbt_dynar_t MSG_environment_as_get_hosts(msg_netzone_t zone) { +static inline XBT_ATTRIB_DEPRECATED_v319( + "Use MSG_zone_get_hosts() instead: v3.19 will remove MSG_environment_as_get_hosts() completely.") xbt_dynar_t + MSG_environment_as_get_hosts(msg_netzone_t zone) +{ xbt_dynar_t res = xbt_dynar_new(sizeof(sg_host_t), NULL); MSG_zone_get_hosts(zone, res); return res; diff --git a/include/simgrid/s4u/Actor.hpp b/include/simgrid/s4u/Actor.hpp index 4d948964e9..99ede18be6 100644 --- a/include/simgrid/s4u/Actor.hpp +++ b/include/simgrid/s4u/Actor.hpp @@ -293,8 +293,7 @@ template inline void sleep_for(std::chrono::duration inline void sleep_for(std::chrono::duration #include -#include // DEPRECATED 3.17 +#include // DEPRECATED 3.20 #include #include @@ -55,31 +55,33 @@ public: return idx; } /** Creates (but don't start) an async send to the mailbox @p dest */ - static CommPtr XBT_ATTRIB_DEPRECATED("please use Mailbox::put_init") // 3.17 + static CommPtr XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_init(): v3.20 will remove Comm::send_init() completely.") send_init(MailboxPtr dest) { return dest->put_init(); } /** Creates (but don't start) an async send to the mailbox @p dest */ - static CommPtr XBT_ATTRIB_DEPRECATED("please use Mailbox::put_init") // 3.17 + static CommPtr XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_init(): v3.20 will remove Comm::send_init() completely.") send_init(MailboxPtr dest, void* data, int simulatedByteAmount) { return dest->put_init(data, simulatedByteAmount); } /** Creates and start an async send to the mailbox @p dest */ - static CommPtr XBT_ATTRIB_DEPRECATED("please use Mailbox::put_async") // 3.17 + static CommPtr XBT_ATTRIB_DEPRECATED_v320( + "Use Mailbox::put_async(): v3.20 will remove Comm::send_async() completely.") send_async(MailboxPtr dest, void* data, int simulatedByteAmount) { return dest->put_async(data, simulatedByteAmount); } /** Creates (but don't start) an async recv onto the mailbox @p from */ - static CommPtr XBT_ATTRIB_DEPRECATED("please use Mailbox::get_init") // 3.17 + static CommPtr XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get_init(): v3.20 will remove Comm::recv_init() completely.") recv_init(MailboxPtr from) { return from->get_init(); } /** Creates and start an async recv to the mailbox @p from */ - static CommPtr XBT_ATTRIB_DEPRECATED("please use Mailbox::get_async") // 3.17 + static CommPtr XBT_ATTRIB_DEPRECATED_v320( + "Use Mailbox::get_async(): v3.20 will remove Comm::recv_async() completely.") recv_async(MailboxPtr from, void** data) { return from->get_async(data); diff --git a/include/simgrid/s4u/ConditionVariable.hpp b/include/simgrid/s4u/ConditionVariable.hpp index b1e2be3e85..c40482fee1 100644 --- a/include/simgrid/s4u/ConditionVariable.hpp +++ b/include/simgrid/s4u/ConditionVariable.hpp @@ -104,8 +104,7 @@ public: void notify_one(); void notify_all(); - XBT_ATTRIB_DEPRECATED("Use notify_one() instead") - void notify() { notify_one(); } + XBT_ATTRIB_DEPRECATED_v319("Use notify_one(): v3.19 will remove notify() completely.") void notify() { notify_one(); } }; using ConditionVariablePtr = ConditionVariable::Ptr; diff --git a/include/xbt/base.h b/include/xbt/base.h index ba5e76fd2b..e2d740c924 100644 --- a/include/xbt/base.h +++ b/include/xbt/base.h @@ -1,6 +1,6 @@ /* xbt.h - Public interface to the xbt (simgrid's toolbox) */ -/* Copyright (c) 2004-2015. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2004-2017. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -47,7 +47,8 @@ #define XBT_ATTRIB_NORETURN __attribute__((noreturn)) #define XBT_ATTRIB_UNUSED __attribute__((unused)) -#define XBT_ATTRIB_DEPRECATED(m) __attribute__((deprecated(m))) +#define XBT_ATTRIB_DEPRECATED_v319(msg) __attribute__((deprecated(msg))) /* Will be dropped in v3.19 */ +#define XBT_ATTRIB_DEPRECATED_v320(msg) __attribute__((deprecated(msg))) /* Will be dropped in v3.20 */ /* Constructor priorities exist since gcc 4.3. Apparently, they are however not * supported on Macs. */