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, ...)
34void deprecation_pending(const char *format, ...)
36
37#define log_deprecation(message, ...) \
38 do { \
39 if (are_deprecation_warnings_enabled()) { \
40 do_log_deprecation(message, ## __VA_ARGS__); \
41 } \
42 } while (FALSE);
43
44#define log_deprecation_alt(altlvl, message, ...) \
45 do { \
46 if (are_deprecation_warnings_enabled()) { \
47 do_log_deprecation(message, ## __VA_ARGS__); \
48 } else { \
49 log_base(altlvl, message, ## __VA_ARGS__); \
50 } \
51 } while (FALSE);
52
53#define log_deprecation_always(message, ...) \
54 do_log_deprecation(message, ## __VA_ARGS__);
55
56#ifdef __cplusplus
57}
58#endif /* __cplusplus */
59
60#endif /* FC__DEPRECATIONS_H */
char * incite_cost
Definition comments.c:76
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__
void void deprecation_pending(const char *format,...) fc__attribute((__format__(__printf__
#define fc__attribute(x)
Definition support.h:99