Skip to content

Commit 6a7fb74

Browse files
committed
Merge branch 'dev'
2 parents d03bf31 + a609e04 commit 6a7fb74

File tree

17 files changed

+336
-53
lines changed

17 files changed

+336
-53
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
jobs:
1010
main:
11-
runs-on: macOS-13
11+
runs-on: macOS-latest
1212
permissions: write-all
1313
steps:
1414
- name: Checkout

.github/workflows/test.yml

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,23 @@ on:
1515
- 'tools/create-release.py'
1616
- '.github/workflows/publish.yml'
1717

18-
env:
19-
DEVELOPER_DIR: /Applications/Xcode_15.0.app
20-
2118
jobs:
22-
main:
23-
runs-on: macOS-13
24-
19+
mac:
20+
runs-on: ${{ matrix.os }}
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
include:
25+
- { os: macOS-13, xcode: '15.0' }
26+
- { os: macOS-13, xcode: '14.3' }
27+
- { os: macos-14, xcode: '15.4.0' }
28+
- { os: macos-15, xcode: '16.4.0' }
29+
- { os: macos-15-intel, xcode: '16.4.0' }
30+
- { os: macos-26, xcode: '26.0' }
31+
32+
env:
33+
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app
34+
2535
steps:
2636
- name: Checkout
2737
uses: actions/checkout@v4
@@ -35,7 +45,17 @@ jobs:
3545
run: DerivedData/Build/Products/Release/test
3646

3747
linux:
38-
runs-on: ubuntu-latest
48+
runs-on: ${{ matrix.os }}
49+
strategy:
50+
fail-fast: false
51+
matrix:
52+
include:
53+
- {os: ubuntu-22.04, version: 16 }
54+
- {os: ubuntu-24.04, version: 17 }
55+
- {os: ubuntu-24.04, version: 18 }
56+
- {os: ubuntu-24.04, version: 19 }
57+
- {os: ubuntu-24.04, version: 20 }
58+
- {os: ubuntu-24.04, version: 21 }
3959

4060
steps:
4161
- name: Checkout
@@ -51,7 +71,7 @@ jobs:
5171
echo "::group::Clang"
5272
wget https://apt.llvm.org/llvm.sh
5373
chmod u+x llvm.sh
54-
sudo ./llvm.sh 16
74+
sudo ./llvm.sh ${{ matrix.version }}
5575
echo "::endgroup::"
5676
5777
echo "::group::libdispatch"
@@ -67,7 +87,7 @@ jobs:
6787
shell: bash
6888
run: |
6989
cd test
70-
CLANG=clang++-16 make
90+
CLANG=clang++-${{ matrix.version }} make
7191
7292
- name: Run tests
7393
shell: bash

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55

66
## Unreleased
77

8+
### Added
9+
- The library has been back-ported to work with Xcode 13 and 14. Previously Xcode 15 or higher was required.
10+
Note that some functionality may be not present or limited on these older versions.
11+
12+
### Fixed
13+
- Formatting `NSString *` via `std::format` and `fmt::format` now works again on latest Xcode/libc++ versions.
14+
815
## [3.1] - 2024-08-08
916

1017
### Added

include/objc-helpers/BoxUtil.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <ostream>
2626
#include <sstream>
2727
#include <filesystem>
28+
#include <compare>
2829

2930

3031
/**
@@ -120,7 +121,7 @@ namespace BoxMakerDetail __attribute__((visibility("hidden"))) {
120121
template<class T>
121122
class __attribute__((visibility("hidden"))) BoxMaker {
122123
private:
123-
static consteval auto detectBoxedType() {
124+
static constexpr auto detectBoxedType() {
124125
if constexpr (std::totally_ordered<T>) {
125126
if constexpr (std::is_copy_constructible_v<T>) {
126127
return (NSObject<BoxedValue, BoxedComparable, NSCopying> *)nullptr;
@@ -284,8 +285,13 @@ class __attribute__((visibility("hidden"))) BoxMaker {
284285
@throw [NSException exceptionWithName:NSInvalidArgumentException reason:@"comparison operand is of invalid type" userInfo:nullptr];
285286
auto * val = (T *)classData.addrOfValue(self);
286287
auto * otherVal = (T *)classData.addrOfValue(other);
288+
#if _LIBCPP_VERSION >= 14000
287289
const auto res = std::compare_strong_order_fallback(*val, *otherVal);
288290
return NSComparisonResult(-(res < 0) + (res > 0));
291+
#else
292+
return NSComparisonResult(-(*val < *otherVal) + (*val > *otherVal));
293+
#endif
294+
289295
}
290296
public:
291297
template<class... Args>
@@ -334,7 +340,7 @@ class __attribute__((visibility("hidden"))) BoxMaker {
334340
*/
335341
template<class T, class... Args>
336342
requires(std::is_constructible_v<T, Args...>)
337-
inline auto box(Args &&... args) -> BoxMaker<T>::BoxedType
343+
inline auto box(Args &&... args) -> typename BoxMaker<T>::BoxedType
338344
{ return BoxMaker<T>::box(std::forward<Args>(args)...); }
339345

340346

@@ -358,7 +364,7 @@ inline auto box(Args &&... args) -> BoxMaker<T>::BoxedType
358364
*/
359365
template<class T>
360366
requires(std::is_constructible_v<std::remove_cvref_t<T>, T &&>)
361-
inline auto box(T && src) -> BoxMaker<T>::BoxedType
367+
inline auto box(T && src) -> typename BoxMaker<T>::BoxedType
362368
{ return BoxMaker<std::remove_cvref_t<T>>::box(std::forward<T>(src)); }
363369

364370
/**

include/objc-helpers/CoDispatch.h

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <cassert>
2727
#include <limits>
2828
#include <utility>
29+
#include <exception>
2930

3031
#include <dispatch/dispatch.h>
3132
#ifndef __OBJC__
@@ -316,7 +317,7 @@ inline namespace CO_DISPATCH_NS {
316317
}
317318

318319
template<class X=ValueCarrier>
319-
static auto moveOutValue(X::ValueToken token) noexcept(IsNoExceptExtractable) -> T
320+
static auto moveOutValue(typename X::ValueToken token) noexcept(IsNoExceptExtractable) -> T
320321
requires(!ValueCarrier::isVoid && std::is_same_v<X, ValueCarrier>) {
321322
Holder & holder = *token;
322323
if constexpr (std::is_reference_v<T>)
@@ -658,7 +659,7 @@ inline namespace CO_DISPATCH_NS {
658659

659660
template<class... Args>
660661
requires(DelayedValue::template IsEmplaceableFrom<Args...>)
661-
void success(Args && ...args) const noexcept(noexcept(m_sharedState->emplaceReturnValue(std::forward<Args>(args)...)))
662+
void success(Args && ...args) const noexcept(noexcept(m_sharedState->emplaceReturnValue(std::forward<Args>(args)...)))
662663
{ m_sharedState->emplaceReturnValue(std::forward<Args>(args)...); }
663664

664665
template<class X=DelayedValue>
@@ -958,7 +959,7 @@ inline namespace CO_DISPATCH_NS {
958959
return awaiter{*this};
959960
}
960961

961-
void return_void() noexcept
962+
void return_void() noexcept
962963
{}
963964

964965
void destroy() const noexcept {
@@ -1026,15 +1027,15 @@ inline namespace CO_DISPATCH_NS {
10261027
return m_valueToken;
10271028
}
10281029
private:
1029-
Iterator(Util::ClientAbandonPtr<Promise> && promise, dispatch_queue_t _Nullable queue, DelayedValue::ValueToken valueToken):
1030+
Iterator(Util::ClientAbandonPtr<Promise> && promise, dispatch_queue_t _Nullable queue, typename DelayedValue::ValueToken valueToken):
10301031
m_promise(std::move(promise)),
10311032
m_queue(queue),
10321033
m_valueToken(valueToken)
10331034
{}
10341035
private:
10351036
Util::ClientAbandonPtr<Promise> m_promise;
10361037
Util::QueueHolder m_queue;
1037-
DelayedValue::ValueToken m_valueToken;
1038+
typename DelayedValue::ValueToken m_valueToken;
10381039
};
10391040

10401041
auto beginOn(dispatch_queue_t _Nullable queue) && noexcept {
@@ -1141,7 +1142,7 @@ inline namespace CO_DISPATCH_NS {
11411142
};
11421143

11431144
/**
1144-
@function
1145+
@function
11451146
Coroutine version of `dispatch_io_read`
11461147
11471148
Unlike `dispatch_io_read` the progressHandler parameter is optional and is only needed if you
@@ -1160,7 +1161,7 @@ inline namespace CO_DISPATCH_NS {
11601161
}
11611162

11621163
/**
1163-
@function
1164+
@function
11641165
Coroutine version of `dispatch_read`
11651166
11661167
@return DispatchIOResult object with operation result
@@ -1174,7 +1175,7 @@ inline namespace CO_DISPATCH_NS {
11741175
}
11751176

11761177
/**
1177-
@function
1178+
@function
11781179
Coroutine version of `dispatch_io_write`
11791180
11801181
Unlike `dispatch_io_write` the progressHandler parameter is optional and is only needed if you
@@ -1194,7 +1195,7 @@ inline namespace CO_DISPATCH_NS {
11941195
}
11951196

11961197
/**
1197-
@function
1198+
@function
11981199
Coroutine version of `dispatch_write`
11991200
12001201
@return DispatchIOResult object with operation result

0 commit comments

Comments
 (0)