1 /***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12 ***********************************************************************/
14 #ifndef FC__DEPRECATIONS_H
15 #define FC__DEPRECATIONS_H
19 #endif /* __cplusplus */
24 typedef void (*deprecation_warn_callback
)(const char *msg
);
26 #define LOG_DEPRECATION LOG_WARN
28 void deprecation_warn_cb_set(deprecation_warn_callback new_cb
);
29 void deprecation_warnings_enable(void);
30 bool are_deprecation_warnings_enabled(void);
32 void do_log_deprecation(const char *format
, ...);
34 #define log_deprecation(message, ...) \
36 if (are_deprecation_warnings_enabled()) { \
37 do_log_deprecation(message, ## __VA_ARGS__); \
41 #define log_deprecation_alt(altlvl, message, ...) \
43 if (are_deprecation_warnings_enabled()) { \
44 do_log_deprecation(message, ## __VA_ARGS__); \
46 log_base(altlvl, message, ## __VA_ARGS__); \
50 #define log_deprecation_always(message, ...) \
51 do_log_deprecation(message, ## __VA_ARGS__);
55 #endif /* __cplusplus */
57 #endif /* FC__DEPRECATIONS_H */