From 43b01c0b359ad75c8755979a85c8603ee040aa08 Mon Sep 17 00:00:00 2001 From: Erwin Nindl Date: Fri, 12 Apr 2024 15:07:37 +0200 Subject: [PATCH] Fix 32bit build --- .../extension/injections/named_parameters.hpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/extension/include/boost/di/extension/injections/named_parameters.hpp b/extension/include/boost/di/extension/injections/named_parameters.hpp index fbffc36423..b6c7d60af7 100644 --- a/extension/include/boost/di/extension/injections/named_parameters.hpp +++ b/extension/include/boost/di/extension/injections/named_parameters.hpp @@ -7,6 +7,7 @@ #pragma once #include "boost/di.hpp" +#include //<- #if defined(__CLANG__) @@ -43,8 +44,8 @@ template struct chars {}; struct pair { - long begin{}; - long end{}; + std::int64_t begin{}; + std::int64_t end{}; }; #if (__GNUC__ >= 9) @@ -53,22 +54,22 @@ struct pair { #endif template constexpr auto operator""_s() { - return aux::integral_constant{}, sizeof...(Chars) + 1)>{}; + return aux::integral_constant{}, sizeof...(Chars) + 1)>{}; } #if (__GNUC__ >= 9) #pragma GCC diagnostic pop #endif -long constexpr const_hash(char const* input, long m = 0, long i = 0) { - return *input && i < m ? static_cast(*input) + 33 * const_hash(input + 1, m, i + 1) : 5381; +std::int64_t constexpr const_hash(char const* input, std::int64_t m = 0, std::int64_t i = 0) { + return *input && i < m ? static_cast(*input) + 33 * const_hash(input + 1, m, i + 1) : 5381; } template -long constexpr const_hash(const chars&, long m = 0, long i = 0) { - return C && i < m ? static_cast(C) + 33 * const_hash(chars{}, m, i + 1) : 5381; +std::int64_t constexpr const_hash(const chars&, std::int64_t m = 0, std::int64_t i = 0) { + return C && i < m ? static_cast(C) + 33 * const_hash(chars{}, m, i + 1) : 5381; } -long constexpr const_hash(const chars<>&, ...) { return 5381; } +std::int64_t constexpr const_hash(const chars<>&, ...) { return 5381; } constexpr pair get_name_impl(const char* input, int begin, int n = 0, int quote = 0) { return !*input || *input == ',' @@ -93,7 +94,7 @@ template struct parse { static constexpr auto name = get_name(T::str, N); using type = aux::conditional_t, TArg>>; + named, TArg>>; }; template