diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 9724944..e73d6d6 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -29,10 +29,19 @@ jobs: - os: ubuntu-latest - os: windows-latest - os: macos-13 # Intel - MACOSX_DEPLOYMENT_TARGET: "10.15" + CIBW_ENVIRONMENT: > + MACOSX_DEPLOYMENT_TARGET='10.15' - os: macos-14 # Apple Silicon - MACOSX_DEPLOYMENT_TARGET: "11.7" + CIBW_ENVIRONMENT: > + MACOSX_DEPLOYMENT_TARGET='11.7' + env: + CIBW_ENVIRONMENT_MACOS: > + MACOSX_DEPLOYMENT_TARGET='11.7' steps: + - uses: ilammy/msvc-dev-cmd@v1 + if: runner.os == 'Windows' + with: + arch: amd64 - uses: actions/checkout@v4 - name: Build wheels uses: pypa/cibuildwheel@v2.16.5 diff --git a/include/cdfpp/cdf-data.hpp b/include/cdfpp/cdf-data.hpp index 617f600..0e75531 100644 --- a/include/cdfpp/cdf-data.hpp +++ b/include/cdfpp/cdf-data.hpp @@ -51,16 +51,16 @@ using cdf_values_t = std::variant, no_init_vector struct data_t { - template + template decltype(auto) get(); - template + template decltype(auto) get() const; - template + template decltype(auto) get(); - template + template decltype(auto) get() const; const char* bytes_ptr() const; @@ -159,23 +159,23 @@ data_t load_values(data_t& data, cdf_encoding encoding); ===================================================================================*/ -template +template inline decltype(auto) data_t::get() { - return std::get>>(this->p_values); + return std::get>>(this->p_values); } -template +template inline decltype(auto) data_t::get() const { - return std::get>>(this->p_values); + return std::get>>(this->p_values); } -template +template decltype(auto) _get_impl(T* self) { - return std::get>(self->p_values); + return std::get>(self->p_values); } template @@ -227,18 +227,18 @@ template } -template +template [[nodiscard]] inline data_t load_values(data_t&& data) noexcept { - if constexpr (type == CDF_Types::CDF_CHAR - || type == CDF_Types::CDF_UCHAR) // special case for strings + if constexpr (_type == CDF_Types::CDF_CHAR + || _type == CDF_Types::CDF_UCHAR) // special case for strings { if constexpr (latin1_to_utf8_conv) { - return data_t { cdf_values_t { iso_8859_1_to_utf8>( + return data_t { cdf_values_t { iso_8859_1_to_utf8>( data.bytes_ptr(), data.bytes()) }, - type }; + _type }; } else { @@ -249,7 +249,7 @@ template { if (std::size(data) != 0UL) endianness::decode_v( - reinterpret_cast*>(data.bytes_ptr()), data.size()); + reinterpret_cast*>(data.bytes_ptr()), data.size()); return std::move(data); } } @@ -257,12 +257,12 @@ template template [[nodiscard]] inline data_t load_values(data_t&& data, cdf_encoding encoding) noexcept { -#define DATA_FROM_T(type) \ - case CDF_Types::type: \ +#define DATA_FROM_T(_type) \ + case CDF_Types::_type: \ if (endianness::is_big_endian_encoding(encoding)) \ - return load_values( \ + return load_values( \ std::move(data)); \ - return load_values( \ + return load_values( \ std::move(data)); @@ -291,22 +291,22 @@ template return {}; } -template +template [[nodiscard]] cdf_values_t new_cdf_values_container(std::size_t len) { - using raw_type = from_cdf_type_t; + using raw_type = from_cdf_type_t<_type>; std::size_t size = len / sizeof(raw_type); return cdf_values_t { no_init_vector(size) }; } -[[nodiscard]] inline data_t new_data_container(std::size_t bytes_len, CDF_Types type) +[[nodiscard]] inline data_t new_data_container(std::size_t bytes_len, CDF_Types _type) { -#define DC_FROM_T(type) \ - case CDF_Types::type: \ - return data_t { new_cdf_values_container(bytes_len), CDF_Types::type }; +#define DC_FROM_T(_type) \ + case CDF_Types::_type: \ + return data_t { new_cdf_values_container(bytes_len), CDF_Types::_type }; - switch (type) + switch (_type) { DC_FROM_T(CDF_FLOAT) DC_FROM_T(CDF_DOUBLE) diff --git a/meson.build b/meson.build index aaf4f8b..6959789 100644 --- a/meson.build +++ b/meson.build @@ -51,7 +51,7 @@ fmt_dep = dependency('fmt') if build_machine.system() == 'windows' link_args = ['-static-libstdc++','-static-libgcc','-static'] -elif build_machine.system() == 'darwin' +elif build_machine.system() == 'darwin' and cpp.get_id() != 'clang' link_args = ['-static-libstdc++','-static-libgcc'] else link_args = []