Skip to content

Commit cc22772

Browse files
committed
deprecate config_file + add warning
Probably not used at all - it was created for some purpose some 10 years ago but perhaps never used outside our internal needs.
1 parent 9869697 commit cc22772

4 files changed

Lines changed: 16 additions & 5 deletions

File tree

src/aja_common.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@
4343
class CNTV2Card;
4444

4545
#ifdef _MSC_VER
46-
#define bug_msg(x, ...) \
47-
log_msg(x, __VA_ARGS__); \
48-
log_msg(x, " Please report a bug if you reach here.\n")
4946
#define color_printf printf
5047
#undef LOG
5148
#include <iostream>

src/config_msvc.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @author Martin Pulec <pulec@cesnet.cz>
44
*/
55
/*
6-
* Copyright (c) 2017-2025 CESNET, zájmové sdružení právnických osob
6+
* Copyright (c) 2017-2026 CESNET, zájmové sdružení právnických osob
77
* All rights reserved.
88
*
99
* Redistribution and use in source and binary forms, with or without
@@ -67,6 +67,10 @@
6767
#define aligned_malloc _aligned_malloc
6868
#define aligned_free _aligned_free
6969

70+
#define bug_msg(log_level, ...) \
71+
fprintf(stderr, __VA_ARGS__); \
72+
fprintf(stderr, "Please report a bug if you reach here.\n")
73+
7074
#endif // defined _MSC_VER
7175

7276
#endif // defined CONFIG_MSVC_H

src/debug.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ bool parse_log_cfg(const char *conf_str,
120120
#if defined __MINGW32__
121121
__MINGW_GNU_PRINTF(2, 3)
122122
void bug_msg(int level, const char *format, ...);
123-
#else
123+
#elif !defined _MSC_VER
124124
void bug_msg(int level, const char *format, ...)
125125
__attribute__((format(printf, 2, 3)));
126126
#endif

src/utils/config_file.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
* @author Martin Pulec <pulec@cesnet.cz>
44
*
55
* @brief Configuration file for UltraGrid
6+
*
7+
* @todo
8+
* TOREMOVE: doesn't seem to be used anyhow - if noone objects to, remove
9+
* after some time (perhaps after next release).
610
*/
711
/*
812
* Copyright (c) 2013-2026 CESNET, zájmové sdružení právnických osob
@@ -44,9 +48,12 @@
4448
#include <cstring>
4549

4650
#include "config_msvc.h"
51+
#include "debug.h"
4752
#include "compat/strings.h" // for strlcpy
4853

4954

55+
#define MOD_NAME "[config_file] "
56+
5057
using namespace std;
5158

5259
struct config_file {
@@ -90,6 +97,9 @@ struct config_file *config_file_open(const char *name)
9097
if (f == NULL) {
9198
return NULL;
9299
}
100+
bug_msg(LOG_LEVEL_WARNING, MOD_NAME
101+
"configuration file is deprecated and about to be removed in "
102+
"future. Please let us know if using this feature. ");
93103
struct config_file *s = (struct config_file *) calloc(1, sizeof(struct config_file));
94104
s->f = f;
95105
strncpy(s->file_name, name, sizeof(s->file_name) - 1);

0 commit comments

Comments
 (0)