From 75b2c7be7eedf44b31cc3ab88d957f37ed6add53 Mon Sep 17 00:00:00 2001 From: Nik Date: Thu, 13 Jul 2023 12:06:02 +0200 Subject: [PATCH] includes/std: Fixed MagicSearch type --- includes/std/mem.pat | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/includes/std/mem.pat b/includes/std/mem.pat index 23ad5ef..00546e4 100644 --- a/includes/std/mem.pat +++ b/includes/std/mem.pat @@ -5,7 +5,27 @@ */ namespace std::mem { - + + namespace impl { + + struct MagicSearchImpl { + if ($ < (std::mem::size() - std::string::length(Magic) - 1)) { + char __potentialMagic__[std::string::length(Magic)] [[hidden, no_unique_address]]; + + if (__potentialMagic__ == Magic) { + T data [[inline]]; + } else { + padding[1]; + continue; + } + } else { + padding[1]; + continue; + } + }; + + } + /** A Handle for a custom Section */ @@ -189,19 +209,7 @@ namespace std::mem { @tparam T The type to place at the address */ struct MagicSearch { - if ($ < (std::mem::size() - std::string::length(Magic) - 1)) { - char __potentialMagic__[std::string::length(Magic)] [[hidden, no_unique_address]]; - - if (__potentialMagic__ == Magic) { - T data [[inline]]; - } else { - padding[1]; - continue; - } - } else { - padding[1]; - continue; - } + std::mem::impl::MagicSearchImpl impl[while(!std::mem::eof())] [[inline]]; }; /**