Skip to content

Commit

Permalink
Merge pull request #25 from nickelpro/dev
Browse files Browse the repository at this point in the history
Add OSX GCC test, fix breakages on GCC 11.2
  • Loading branch information
ThePhD committed Apr 18, 2022
2 parents 71d571d + f48a7e3 commit 1d5904a
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 6 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/macosx-gcc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Mac OSX GCC

on: [push, pull_request]

env:
CTEST_OUTPUT_ON_FAILURE: 1

jobs:
build:

runs-on: macos-latest

steps:
- uses: actions/checkout@v2
with:
submodules: recursive

- name: configure
run: |
cmake -B build/debug -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11 -D ZTD_TEXT_TESTS=ON -D ZTD_TEXT_EXAMPLES=ON -D ZTD_TEXT_GENERATE_SINGLE=ON
cmake -B build/release -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11 -D ZTD_TEXT_TESTS=ON -D ZTD_TEXT_EXAMPLES=ON -D ZTD_TEXT_GENERATE_SINGLE=ON
- name: build
run: |
cmake --build build/debug --config Debug
cmake --build build/release --config Release
- name: test
run: |
cd build/debug
ctest --build-config Debug
cd ../..
cd build/release
ctest --build-config Release
cd ../..
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#include <ztd/text.hpp>

#if !defined(_LIBCPP_VERSION)
#if !defined(_LIBCPP_VERSION) && ZTD_IS_OFF(ZTD_PLATFORM_MAC_OS_I_)
// This example doesn't work on Apple/libc++ because they don't have
// standard C or C++ headers.

Expand Down
2 changes: 1 addition & 1 deletion include/ztd/text/execution.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ namespace ztd { namespace text {
/// do not support the @c \<cuchar\> or @c \<uchar.h\> headers.
//////
using execution_t =
#if ZTD_IS_ON(ZTD_CUCHAR_I_) || ZTD_IS_ON(ZTD_UCHAR_I_)
#if (ZTD_IS_ON(ZTD_CUCHAR_I_) || ZTD_IS_ON(ZTD_UCHAR_I_)) && ZTD_IS_OFF(ZTD_PLATFORM_MAC_OS_I_)
__txt_impl::__execution_cuchar
#elif ZTD_IS_ON(ZTD_PLATFORM_MAC_OS_I_)
__txt_impl::__execution_mac_os
Expand Down
2 changes: 1 addition & 1 deletion include/ztd/text/forward.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ namespace ztd { namespace text {
using utf32_t = basic_utf32<char32_t, unicode_code_point>;

using execution_t =
#if ZTD_IS_ON(ZTD_CUCHAR_I_) || ZTD_IS_ON(ZTD_UCHAR_I_)
#if (ZTD_IS_ON(ZTD_CUCHAR_I_) || ZTD_IS_ON(ZTD_UCHAR_I_)) && ZTD_IS_OFF(ZTD_PLATFORM_MAC_OS_I_)
__txt_impl::__execution_cuchar
#elif ZTD_IS_ON(ZTD_TEXT_ICONV_I_)
__txt_impl::__execution_iconv
Expand Down
2 changes: 1 addition & 1 deletion include/ztd/text/impl/execution_cuchar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
#include <ztd/idk/encoding_detection.h>
#include <ztd/idk/detail/windows.hpp>

#if ZTD_IS_ON(ZTD_CUCHAR_I_) || ZTD_IS_ON(ZTD_UCHAR_I_)
#if (ZTD_IS_ON(ZTD_CUCHAR_I_) || ZTD_IS_ON(ZTD_UCHAR_I_)) && ZTD_IS_OFF(ZTD_PLATFORM_MAC_OS_I_)

// clang-format off
#if ZTD_IS_ON(ZTD_CUCHAR_I_)
Expand Down
6 changes: 4 additions & 2 deletions include/ztd/text/impl/wide_execution_cwchar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,9 @@ namespace ztd { namespace text {
}

execution_t __exec {};
__txt_detail::__pass_through_handler_with<!__call_error_handler> __intermediate_handler {};
__txt_detail::__progress_handler<::std::integral_constant<bool, !__call_error_handler>,
__wide_execution_cwchar>
__intermediate_handler {};
::ztd::span<char, __state_max> __intermediate_input(__intermediate_buffer, __state_max);
auto __result = __exec.decode_one(__intermediate_input, ::std::forward<_OutputRange>(__output),
__intermediate_handler, __s.__narrow_state);
Expand All @@ -466,7 +468,7 @@ namespace ztd { namespace text {
::std::move(__inlast)),
::std::move(__result.output), __s, __result.error_code),
::ztd::span<code_unit>(::std::addressof(__units[0]), __units_count),
__intermediate_handler.__M_code_points_progress());
__intermediate_handler._M_code_points_progress());
}
}
return _Result(ranges::reconstruct(
Expand Down

0 comments on commit 1d5904a

Please sign in to comment.