XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
/* Executed on process termination*/
-static int my_onexit(void* XBT_ATTRIB_UNUSED ignored1, void* XBT_ATTRIB_UNUSED ignored2)
+static int my_onexit(XBT_ATTRIB_UNUSED void* ignored1, XBT_ATTRIB_UNUSED void* ignored2)
{
XBT_INFO("Exiting now (done sleeping or got killed)."); /* - Just display an informative message (see tesh file) */
return 0;
XBT_PUBLIC(void) MSG_zone_set_property_value(msg_netzone_t netzone, const char* name, char* value);
XBT_PUBLIC(void) MSG_zone_get_hosts(msg_netzone_t zone, xbt_dynar_t whereto);
-static inline XBT_ATTRIB_DEPRECATED_v319("Use MSG_zone_get_root() instead: v3.19 will turn this warning into an error.")
- msg_netzone_t MSG_environment_get_routing_root()
+XBT_ATTRIB_DEPRECATED_v319(
+ "Use MSG_zone_get_root() instead: v3.19 will turn this warning into an error.") static inline msg_netzone_t
+ MSG_environment_get_routing_root()
{
return MSG_zone_get_root();
}
-static inline XBT_ATTRIB_DEPRECATED_v319("Use MSG_zone_get_name() instead: v3.19 will turn this warning into an error.")
- const char* MSG_environment_as_get_name(msg_netzone_t zone)
+XBT_ATTRIB_DEPRECATED_v319(
+ "Use MSG_zone_get_name() instead: v3.19 will turn this warning into an error.") static inline const
+ char* MSG_environment_as_get_name(msg_netzone_t zone)
{
return MSG_zone_get_name(zone);
}
-static inline XBT_ATTRIB_DEPRECATED_v319(
- "Use MSG_zone_get_by_name() instead: v3.19 will turn this warning into an error.") msg_netzone_t
+XBT_ATTRIB_DEPRECATED_v319(
+ "Use MSG_zone_get_by_name() instead: v3.19 will turn this warning into an error.") static inline msg_netzone_t
MSG_environment_as_get_by_name(const char* name)
{
return MSG_zone_get_by_name(name);
}
-static inline XBT_ATTRIB_DEPRECATED_v319("Use MSG_zone_get_sons() instead: v3.19 will turn this warning into an error.")
- xbt_dict_t MSG_environment_as_get_routing_sons(msg_netzone_t zone)
+XBT_ATTRIB_DEPRECATED_v319(
+ "Use MSG_zone_get_sons() instead: v3.19 will turn this warning into an error.") static inline 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_v319(
- "Use MSG_zone_get_property_value() instead: v3.19 will turn this warning into an error.") const
+XBT_ATTRIB_DEPRECATED_v319(
+ "Use MSG_zone_get_property_value() instead: v3.19 will turn this warning into an error.") static inline 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_v319(
+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)
+ "completely.") static inline 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_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_ATTRIB_DEPRECATED_v319("Use MSG_zone_get_hosts() instead: v3.19 will remove MSG_environment_as_get_hosts() "
+ "completely.") static inline 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);
XBT_PUBLIC(int) MSG_host_is_on(msg_host_t h);
XBT_PUBLIC(int) MSG_host_is_off(msg_host_t h);
-static inline double
- XBT_ATTRIB_DEPRECATED_v319("Use MSG_host_get_speed(): v3.19 will drop MSG_get_host_speed() completely.")
- MSG_get_host_speed(msg_host_t host)
+XBT_ATTRIB_DEPRECATED_v319("Use MSG_host_get_speed(): v3.19 will drop MSG_get_host_speed() "
+ "completely.") static inline double MSG_get_host_speed(msg_host_t host)
{
return MSG_host_get_speed(host);
}
-static inline double XBT_ATTRIB_DEPRECATED_v320(
- "Use MSG_host_get_speed(): v3.20 will drop MSG_host_get_current_power_peak() completely.")
- MSG_host_get_current_power_peak(msg_host_t host)
+XBT_ATTRIB_DEPRECATED_v320("Use MSG_host_get_speed(): v3.20 will drop MSG_host_get_current_power_peak() "
+ "completely.") static inline double MSG_host_get_current_power_peak(msg_host_t host)
{
return MSG_host_get_speed(host);
}
XBT_PUBLIC(msg_comm_t) MSG_task_isend(msg_task_t task, const char *alias);
XBT_PUBLIC(msg_comm_t) MSG_task_isend_bounded(msg_task_t task, const char *alias, double maxrate);
-XBT_PUBLIC(msg_comm_t)
XBT_ATTRIB_DEPRECATED_v320(
"This function will be removed from SimGrid v3.20. If you really need this function, please speak up quickly.")
- MSG_task_isend_with_matching(msg_task_t task, const char* alias, int (*match_fun)(void*, void*, void*),
- void* match_data);
+ XBT_PUBLIC(msg_comm_t) MSG_task_isend_with_matching(msg_task_t task, const char* alias,
+ int (*match_fun)(void*, void*, void*), void* match_data);
XBT_PUBLIC(void) MSG_task_dsend(msg_task_t task, const char *alias, void_f_pvoid_t cleanup);
XBT_PUBLIC(void) MSG_task_dsend_bounded(msg_task_t task, const char *alias, void_f_pvoid_t cleanup, double maxrate);
*
* See \ref Comm for the full communication API (including non blocking communications).
*/
-XBT_PUBLIC(void*)
-XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get(): v3.20 will turn this warning into an error.") recv(MailboxPtr chan);
-XBT_PUBLIC(void*)
-XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get(): v3.20 will turn this warning into an error.")
+XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get(): v3.20 will turn this warning into an error.") XBT_PUBLIC(void*)
+ recv(MailboxPtr chan);
+XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get(): v3.20 will turn this warning into an error.") XBT_PUBLIC(void*)
recv(MailboxPtr chan, double timeout);
-XBT_PUBLIC(CommPtr)
-XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::recv_async(): v3.20 will turn this warning into an error.")
+XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::recv_async(): v3.20 will turn this warning into an error.") XBT_PUBLIC(CommPtr)
irecv(MailboxPtr chan, void** data);
/** Block the actor until it delivers a message of the given simulated size to the given mailbox
*
* See \ref Comm for the full communication API (including non blocking communications).
*/
-XBT_PUBLIC(void)
-XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put(): v3.20 will turn this warning into an error.")
- send(MailboxPtr chan, void* payload, double simulatedSize); // 3.17
-XBT_PUBLIC(void)
-XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put(): v3.20 will turn this warning into an error.")
- send(MailboxPtr chan, void* payload, double simulatedSize, double timeout); // 3.17
-
-XBT_PUBLIC(CommPtr)
-XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_async(): v3.20 will turn this warning into an error.")
+XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put(): v3.20 will turn this warning into an error.") XBT_PUBLIC(void)
+ send(MailboxPtr chan, void* payload, double simulatedSize);
+XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put(): v3.20 will turn this warning into an error.") XBT_PUBLIC(void)
+ send(MailboxPtr chan, void* payload, double simulatedSize, double timeout);
+
+XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_async(): v3.20 will turn this warning into an error.") XBT_PUBLIC(CommPtr)
isend(MailboxPtr chan, void* payload, double simulatedSize);
/** @brief Returns the actor ID of the current actor (same as pid). */
}
/** Creates (but don't start) an async send to the mailbox @p dest */
- static CommPtr XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_init(): v3.20 will turn this warning into an error.")
- send_init(MailboxPtr dest)
+ XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_init(): v3.20 will turn this warning into an error.") static CommPtr
+ 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_v320("Use Mailbox::put_init(): v3.20 will turn this warning into an error.")
- send_init(MailboxPtr dest, void* data, int simulatedByteAmount)
+ XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_init(): v3.20 will turn this warning into an error.") static CommPtr
+ 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_v320("Use Mailbox::put_async(): v3.20 will turn this warning into an error.")
- send_async(MailboxPtr dest, void* data, int simulatedByteAmount)
+ XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_async(): v3.20 will turn this warning into an error.") static CommPtr
+ 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_v320("Use Mailbox::get_init(): v3.20 will turn this warning into an error.")
- recv_init(MailboxPtr from)
+ XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get_init(): v3.20 will turn this warning into an error.") static CommPtr
+ recv_init(MailboxPtr from)
{
return from->get_init();
}
/** Creates and start an async recv to the mailbox @p from */
- static CommPtr XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get_async(): v3.20 will turn this warning into an error.")
- recv_async(MailboxPtr from, void** data)
+ XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get_async(): v3.20 will turn this warning into an error.") static CommPtr
+ recv_async(MailboxPtr from, void** data)
{
return from->get_async(data);
}
/** @brief Callback signal fired when a communication changes it state (ready/done/cancel) */
static simgrid::xbt::signal<void(surf::NetworkAction*)> onCommunicationStateChange;
- const char* XBT_ATTRIB_DEPRECATED_v321("Use getCname(): v3.21 will turn this warning into an error.") name();
+ XBT_ATTRIB_DEPRECATED_v321("Use getCname(): v3.21 will turn this warning into an error.") const char* name();
};
}
}
__attribute__((__format__ (__scanf__, format_idx, arg_idx)))
#endif
+#if defined(__cplusplus)
+#if __cplusplus >= 201103L
+#define XBT_ATTRIB_NORETURN [[noreturn]]
+#endif
+#if __cplusplus >= 201703L
+#define XBT_ATTRIB_UNUSED [[maybe_unused]]
+#endif
+#if __cplusplus >= 201402L
+#define XBT_ATTRIB_DEPRECATED(msg) [[deprecated(msg)]]
+#endif
+#elif defined(__STDC_VERSION__)
+#if __STDC_VERSION__ >= 201112L
+#define XBT_ATTRIB_NORETURN _Noreturn
+#endif
+#endif
+
+#ifndef XBT_ATTRIB_NORETURN
#define XBT_ATTRIB_NORETURN __attribute__((noreturn))
+#endif
+#ifndef XBT_ATTRIB_UNUSED
#define XBT_ATTRIB_UNUSED __attribute__((unused))
-#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 */
-#define XBT_ATTRIB_DEPRECATED_v321(msg) __attribute__((deprecated(msg))) /* Will be dropped in v3.21 */
+#endif
+#ifndef XBT_ATTRIB_DEPRECATED
+#define XBT_ATTRIB_DEPRECATED(msg) __attribute__((deprecated(msg)))
+#endif
+
+#define XBT_ATTRIB_DEPRECATED_v319(msg) XBT_ATTRIB_DEPRECATED(msg) /* Will be dropped in v3.19 */
+#define XBT_ATTRIB_DEPRECATED_v320(msg) XBT_ATTRIB_DEPRECATED(msg) /* Will be dropped in v3.20 */
+#define XBT_ATTRIB_DEPRECATED_v321(msg) XBT_ATTRIB_DEPRECATED(msg) /* Will be dropped in v3.21 */
/* Constructor priorities exist since gcc 4.3. Apparently, they are however not
* supported on Macs. */
xbt_dictelm_t next;
} s_xbt_dictelm_t;
-XBT_PUBLIC(xbt_dict_t)
XBT_ATTRIB_DEPRECATED_v319("Use xbt_dict_new_homogeneous(). v3.19 will turn this warning into an error.")
- xbt_dict_new();
+ XBT_PUBLIC(xbt_dict_t) xbt_dict_new();
XBT_PUBLIC(xbt_dict_t) xbt_dict_new_homogeneous(void_f_pvoid_t free_ctn);
XBT_PUBLIC(void) xbt_dict_free(xbt_dict_t * dict);
XBT_PUBLIC(unsigned int) xbt_dict_size(xbt_dict_t dict);
XBT_PUBLIC(void *) xbt_dict_get(xbt_dict_t dict, const char *key);
XBT_PUBLIC(void *) xbt_dict_get_or_null(xbt_dict_t dict, const char *key);
XBT_PUBLIC(char*) xbt_dict_get_key(xbt_dict_t dict, const void* data);
-XBT_PUBLIC(char*)
-XBT_ATTRIB_DEPRECATED_v321("xbt_dict is dying. v3.21 will turn this warning into an error.")
+XBT_ATTRIB_DEPRECATED_v321("xbt_dict is dying. v3.21 will turn this warning into an error.") XBT_PUBLIC(char*)
xbt_dict_get_elm_key(xbt_dictelm_t elem);
XBT_PUBLIC(xbt_dictelm_t) xbt_dict_get_elm(xbt_dict_t dict, const char *key);
XBT_PUBLIC(xbt_dictelm_t) xbt_dict_get_elm_or_null(xbt_dict_t dict, const char *key);
XBT_PUBLIC(void) xbt_dict_remove(xbt_dict_t dict, const char *key);
XBT_PUBLIC(void) xbt_dict_reset(xbt_dict_t dict);
XBT_PUBLIC(int) xbt_dict_length(xbt_dict_t dict);
-XBT_PUBLIC(void)
-XBT_ATTRIB_DEPRECATED_v321("xbt_dict is dying. v3.21 will turn this warning into an error.")
+XBT_ATTRIB_DEPRECATED_v321("xbt_dict is dying. v3.21 will turn this warning into an error.") XBT_PUBLIC(void)
xbt_dict_dump_output_string(void* s);
XBT_PUBLIC(void) xbt_dict_dump(xbt_dict_t dict, void (*output) (void *));
-XBT_PUBLIC(void)
-XBT_ATTRIB_DEPRECATED_v321("xbt_dict is dying. v3.21 will turn this warning into an error.")
+XBT_ATTRIB_DEPRECATED_v321("xbt_dict is dying. v3.21 will turn this warning into an error.") XBT_PUBLIC(void)
xbt_dict_dump_sizes(xbt_dict_t dict);
XBT_PUBLIC(int) xbt_dict_is_empty(xbt_dict_t dict);
XBT_PUBLIC(char *) xbt_dict_cursor_get_key(xbt_dict_cursor_t cursor);
XBT_PUBLIC(void *) xbt_dict_cursor_get_data(xbt_dict_cursor_t cursor);
-XBT_PUBLIC(void)
-XBT_ATTRIB_DEPRECATED_v321("xbt_dict is dying. v3.21 will turn this warning into an error.")
+XBT_ATTRIB_DEPRECATED_v321("xbt_dict is dying. v3.21 will turn this warning into an error.") XBT_PUBLIC(void)
xbt_dict_cursor_set_data(xbt_dict_cursor_t cursor, void* data, void_f_pvoid_t free_ctn);
XBT_PUBLIC(void) xbt_dict_cursor_first(const xbt_dict_t dict, xbt_dict_cursor_t * cursor);
typedef struct xbt_ex xbt_ex_t;
/** Helper function used to throw exceptions in C */
-XBT_PUBLIC(void) _xbt_throw(char* message, xbt_errcat_t errcat, int value, const char* file, int line, const char* func) XBT_ATTRIB_NORETURN;
+XBT_ATTRIB_NORETURN XBT_PUBLIC(void)
+ _xbt_throw(char* message, xbt_errcat_t errcat, int value, const char* file, int line, const char* func);
/** Builds and throws an exception
* @ingroup XBT_ex_c
/* log - a generic logging facility in the spirit of log4j */
-/* 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. */
#if defined(XBT_LOG_MAYDAY) /*|| defined (NLOG) * turning logging off */
# define XBT_LOG_DEFAULT_CATEGORY(cname)
#else
-# define XBT_LOG_DEFAULT_CATEGORY(cname) \
- static xbt_log_category_t _XBT_LOGV(default) XBT_ATTRIB_UNUSED = &_XBT_LOGV(cname)
+#define XBT_LOG_DEFAULT_CATEGORY(cname) \
+ XBT_ATTRIB_UNUSED static xbt_log_category_t _XBT_LOGV(default) = &_XBT_LOGV(cname)
#endif
/**
* @{
*/
/** @brief Kill the program in silence */
-XBT_PUBLIC(void) XBT_ATTRIB_NORETURN xbt_abort(void);
+XBT_ATTRIB_NORETURN XBT_PUBLIC(void) xbt_abort(void);
/**
* @brief Kill the program with an error message
XBT_PUBLIC(void) surf_parse_open(const char *file);
XBT_PUBLIC(void) surf_parse_close();
XBT_PUBLIC(void) surf_parse_assert(bool cond, std::string msg);
-XBT_PUBLIC(void) XBT_ATTRIB_NORETURN surf_parse_error(std::string msg);
+XBT_ATTRIB_NORETURN XBT_PUBLIC(void) surf_parse_error(std::string msg);
XBT_PUBLIC(void) surf_parse_assert_netpoint(std::string hostname, std::string pre, std::string post);
XBT_PUBLIC(void) surf_parse_warn(std::string msg);
return a->transitions;
}
-xbt_automaton_transition_t xbt_automaton_get_transition(xbt_automaton_t XBT_ATTRIB_UNUSED a, xbt_automaton_state_t src,
+xbt_automaton_transition_t xbt_automaton_get_transition(XBT_ATTRIB_UNUSED xbt_automaton_t a, xbt_automaton_state_t src,
xbt_automaton_state_t dst)
{
xbt_automaton_transition_t transition;
{
xbt_ex_t ex;
int r1;
- int XBT_ATTRIB_UNUSED r2;
+ XBT_ATTRIB_UNUSED int r2;
int v1;
int v2;
return mm_fake_malloc(n);
}
-static void* mm_fake_realloc(void* XBT_ATTRIB_UNUSED p, size_t s)
+static void* mm_fake_realloc(XBT_ATTRIB_UNUSED void* p, size_t s)
{
return mm_fake_malloc(s);
}
-static void mm_fake_free(void* XBT_ATTRIB_UNUSED p)
+static void mm_fake_free(XBT_ATTRIB_UNUSED void* p)
{
// Nothing to do
}
/** Constructor functions used to initialize the malloc implementation
*/
-static void __attribute__((constructor(101))) mm_legacy_constructor()
+_XBT_GNUC_CONSTRUCTOR(101) static void mm_legacy_constructor()
{
if (mm_initialized)
return;
} else \
return 0
-static int xbt_log_layout_simple_doit(xbt_log_layout_t XBT_ATTRIB_UNUSED l, xbt_log_event_t ev, const char* fmt)
+static int xbt_log_layout_simple_doit(XBT_ATTRIB_UNUSED xbt_log_layout_t l, xbt_log_event_t ev, const char* fmt)
{
char *p = ev->buffer;
int rem_size = ev->buffer_size;
return 1;
}
-xbt_log_layout_t xbt_log_layout_simple_new(char* XBT_ATTRIB_UNUSED arg)
+xbt_log_layout_t xbt_log_layout_simple_new(XBT_ATTRIB_UNUSED char* arg)
{
xbt_log_layout_t res = xbt_new0(s_xbt_log_layout_t, 1);
res->do_layout = &xbt_log_layout_simple_doit;
*
* If pthread_setaffinity_np is not usable on that (non-gnu) platform, this function does nothing.
*/
-int xbt_os_thread_bind(xbt_os_thread_t XBT_ATTRIB_UNUSED thread, int XBT_ATTRIB_UNUSED cpu)
+int xbt_os_thread_bind(XBT_ATTRIB_UNUSED xbt_os_thread_t thread, XBT_ATTRIB_UNUSED int cpu)
{
int errcode = 0;
#if HAVE_PTHREAD_SETAFFINITY
int rank, size, verbose = 0, errs=0, tot_errs=0;
int wrank;
MPI_Comm comm;
- MPI_Info __attribute__((unused)) info;
+ XBT_ATTRIB_UNUSED MPI_Info info;
MPI_Init(&argc, &argv);