From 860c9638966d448fe7dafe46a5f2f32921c818f6 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Fri, 10 Feb 2023 09:40:43 -0500 Subject: [PATCH] fix(WasmMapComponentType): Support 32-bit long In WASI. --- include/itkWasmMapComponentType.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/include/itkWasmMapComponentType.h b/include/itkWasmMapComponentType.h index ba4a10194..d284f325f 100644 --- a/include/itkWasmMapComponentType.h +++ b/include/itkWasmMapComponentType.h @@ -19,6 +19,7 @@ #define itkWasmMapComponentType_h #include +#include "itkIntTypes.h" namespace itk { @@ -76,17 +77,33 @@ struct MapComponentType static constexpr std::string_view ComponentString = "uint32"; }; +#if ((LLONG_MAX != LONG_MAX)) +template <> +struct MapComponentType +{ + static constexpr std::string_view ComponentString = "int32"; +}; +#else template <> struct MapComponentType { static constexpr std::string_view ComponentString = "int64"; }; +#endif +#if ((ULLONG_MAX != ULONG_MAX)) +template <> +struct MapComponentType +{ + static constexpr std::string_view ComponentString = "uint32"; +}; +#else template <> struct MapComponentType { static constexpr std::string_view ComponentString = "uint64"; }; +#endif template <> struct MapComponentType