Freeciv-3.3
Loading...
Searching...
No Matches
deprecations.c
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#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif /* HAVE_CONFIG_H */
17
18#include "fc_prehdrs.h"
19
20#include <stdarg.h>
21
22/* utility */
23#include "log.h"
24#include "shared.h"
25
26#include "deprecations.h"
27
29
31
32/********************************************************************/
39
40/********************************************************************/
47
48/********************************************************************/
55
56/********************************************************************/
59void do_log_deprecation(const char *format, ...)
60{
61 va_list args;
62 char buf[1024];
63
64 va_start(args, format);
66 buf, sizeof(buf), format, args);
67 if (depr_cb != nullptr) {
68 depr_cb(buf);
69 }
70 va_end(args);
71}
char * incite_cost
Definition comments.c:74
void deprecation_warn_cb_set(deprecation_warn_callback new_cb)
bool are_deprecation_warnings_enabled(void)
void do_log_deprecation(const char *format,...)
void deprecation_warnings_enable(void)
static bool depr_warns_enabled
static deprecation_warn_callback depr_cb
void(* deprecation_warn_callback)(const char *msg)
#define LOG_DEPRECATION
void vdo_log(const char *file, const char *function, int line, bool print_from_where, enum log_level level, char *buf, int buflen, const char *message, va_list args)
Definition log.c:403
#define __FC_LINE__
Definition log.h:40
#define TRUE
Definition support.h:46
#define FALSE
Definition support.h:47