Freeciv-3.3
Loading...
Searching...
No Matches
deprecations.h
Go to the documentation of this file.
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)
6 any later version.
7
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***********************************************************************/
13
14#ifndef FC__DEPRECATIONS_H
15#define FC__DEPRECATIONS_H
16
17#ifdef __cplusplus
18extern "C" {
19#endif /* __cplusplus */
20
21/* utility */
22#include "log.h"
23
24typedef void (*deprecation_warn_callback)(const char *msg);
25
26#define LOG_DEPRECATION LOG_WARN
27
31
32void do_log_deprecation(const char *format, ...)
34
35#define log_deprecation(message, ...) \
36 do { \
37 if (are_deprecation_warnings_enabled()) { \
38 do_log_deprecation(message, ## __VA_ARGS__); \
39 } \
40 } while (FALSE);
41
42#define log_deprecation_alt(altlvl, message, ...) \
43 do { \
44 if (are_deprecation_warnings_enabled()) { \
45 do_log_deprecation(message, ## __VA_ARGS__); \
46 } else { \
47 log_base(altlvl, message, ## __VA_ARGS__); \
48 } \
49 } while (FALSE);
50
51#define log_deprecation_always(message, ...) \
52 do_log_deprecation(message, ## __VA_ARGS__);
53
54#ifdef __cplusplus
55}
56#endif /* __cplusplus */
57
58#endif /* FC__DEPRECATIONS_H */
char * incite_cost
Definition comments.c:74
void(* deprecation_warn_callback)(const char *msg)
void deprecation_warn_cb_set(deprecation_warn_callback new_cb)
bool are_deprecation_warnings_enabled(void)
void deprecation_warnings_enable(void)
void do_log_deprecation(const char *format,...) fc__attribute((__format__(__printf__
#define fc__attribute(x)
Definition support.h:99