1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-12 17:14:46 +02:00

Conditional Config: add @warning "aaa" and @error "bbb"

As usual, this is mostly for configuration templates that you use for
multiple servers, that sort of things, eg.

@if !environment("ADMIN")
@error "Environment variable ADMIN is not set"
@endif

This also adds a change in conf.c so @define, @error and
@warning are skipped in @if blocks that evaluate to false
(that's obviously what everyone wants :D). So that fixes a
previous bug with @define in @if.
This commit is contained in:
Bram Matthys
2026-03-23 18:34:50 +01:00
parent 8adfdf95a0
commit 3dd449139b
5 changed files with 60 additions and 1 deletions
+1
View File
@@ -80,6 +80,7 @@ extern PreprocessorItem parse_preprocessor_item(char *start, char *end, const ch
extern void preprocessor_cc_duplicate_list(ConditionalConfig *r, ConditionalConfig **out);
extern void preprocessor_cc_free_level(ConditionalConfig **cc_list, int level);
extern void preprocessor_cc_free_list(ConditionalConfig *cc);
extern int preprocessor_resolve_if(ConditionalConfig *cc, PreprocessorPhase phase);
extern void preprocessor_resolve_conditionals_ce(ConfigEntry **ce_list, PreprocessorPhase phase);
extern void preprocessor_resolve_conditionals_all(PreprocessorPhase phase);
extern void init_config_defines(void);
+3 -1
View File
@@ -1611,7 +1611,9 @@ typedef enum PreprocessorItem {
PREPROCESSOR_DEFINE = 1,
PREPROCESSOR_IF = 2,
PREPROCESSOR_ENDIF = 3,
PREPROCESSOR_ELSE = 4
PREPROCESSOR_ELSE = 4,
PREPROCESSOR_USER_ERROR = 5,
PREPROCESSOR_USER_WARNING = 6
} PreprocessorItem;
typedef enum PreprocessorPhase {