From 7a8b28f0f400920895e0c361a58ed6c640ac4de1 Mon Sep 17 00:00:00 2001 From: Les De Ridder Date: Wed, 14 Oct 2020 05:34:05 +0200 Subject: [PATCH] Fix versions and add 'modern' configuration --- dub.sdl | 7 +++++++ source/ircd/versions.d | 27 +++++++++++++++------------ 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/dub.sdl b/dub.sdl index dea085e..4936d33 100644 --- a/dub.sdl +++ b/dub.sdl @@ -10,3 +10,10 @@ dependency "sdlang-d" version="~>0.10.5" preGenerateCommands "./generate-package-version.fish" versions "VibeDefaultMain" targetPath "out" + +configuration "application" { +} + +configuration "modern" { + versions "BasicFixes" "SupportTLS" +} diff --git a/source/ircd/versions.d b/source/ircd/versions.d index a22569c..099f800 100644 --- a/source/ircd/versions.d +++ b/source/ircd/versions.d @@ -3,27 +3,30 @@ module ircd.versions; /++ Supported versions: - * NotStrict: enabled when any versions are enabled that disable RFC-strictness (i.e. any of the following) - * SupportTLS: compile with TLS support, enabled when NotStrict is on + * SupportTLS: compile with TLS support * BasicFixes: enable basic/sanity RFC fixes * MaxNickLengthConfigurable: makes max nick length configurable * Modern: enable all versions + + (* NotStrict: enabled when any versions are enabled that disable RFC-strictness, i.e. any of the above) +/ +version (Modern) +{ + version = SupportTLS; + version = BasicFixes; + version = MaxNickLengthConfigurable; +} + version (SupportTLS) version = NotStrict; version (BasicFixes) version = NotStrict; version (MaxNickLengthConfigurable) version = NotStrict; version (NotStrict) { - version = SupportTLS; -} - -version (Modern) -{ - version = NotStrict; - - version = SupportTLS; - version = BasicFixes; - version = MaxNickLengthConfigurable; + version (SupportTLS) {} + else + { + static assert(false, "TLS support must be enabled if any non-strict versions are enabled."); + } }