From 311d11ef10b9bd12dd579e47eeff3472f3336f92 Mon Sep 17 00:00:00 2001 From: park-byeong-gwan Date: Sat, 24 Aug 2024 12:03:04 +0900 Subject: [PATCH 1/3] fix compile failure in iOS modern xcode --- 3rdparty/celt-0.7.0-build/Base.xcconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3rdparty/celt-0.7.0-build/Base.xcconfig b/3rdparty/celt-0.7.0-build/Base.xcconfig index d1f5f4b..121de43 100644 --- a/3rdparty/celt-0.7.0-build/Base.xcconfig +++ b/3rdparty/celt-0.7.0-build/Base.xcconfig @@ -10,7 +10,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 8.0 SKIP_INSTALL = YES -OTHER_CFLAGS = -x c++ +//OTHER_CFLAGS = -x c++ HEADER_SEARCH_PATHS = . ALWAYS_SEARCH_USER_PATHS = NO From e1660ab5d4d22f2e3ae67d9c73bc36bf8a3a3958 Mon Sep 17 00:00:00 2001 From: pbk Date: Fri, 23 Aug 2024 23:06:30 +0000 Subject: [PATCH 2/3] fix compile error on macOS --- src/MKMacAudioDevice.m | 4 ++-- src/MKVoiceProcessingDevice.m | 14 +++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/MKMacAudioDevice.m b/src/MKMacAudioDevice.m index 2be75d1..9abe363 100644 --- a/src/MKMacAudioDevice.m +++ b/src/MKMacAudioDevice.m @@ -58,13 +58,13 @@ static OSStatus inputCallback(void *udata, AudioUnitRenderActionFlags *flags, co actual read bytes count. We need to write it back otherwise we'll reallocate the buffer even if not needed. */ - UInt32 dataByteSize = dev->_buflist.mBuffers->mDataByteSize; + UInt32 dataByteSize = dev->_recordBufList.mBuffers->mDataByteSize; err = AudioUnitRender(dev->_recordAudioUnit, flags, ts, busnum, nframes, &dev->_recordBufList); if (err != noErr) { NSLog(@"MKMacAudioDevice: AudioUnitRender failed. err = %ld", (unsigned long)err); return err; } - dev->_buflist.mBuffers->mDataByteSize = dataByteSize; + dev->_recordBufList.mBuffers->mDataByteSize = dataByteSize; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; short *buf = (short *) dev->_recordBufList.mBuffers->mData; diff --git a/src/MKVoiceProcessingDevice.m b/src/MKVoiceProcessingDevice.m index 02d0b3e..e21cded 100644 --- a/src/MKVoiceProcessingDevice.m +++ b/src/MKVoiceProcessingDevice.m @@ -9,7 +9,17 @@ #import #import #import -#import +#if defined(TARGET_OS_VISION) && TARGET_OS_VISION + #define IS_UIDEVICE_AVAILABLE 1 +#elif TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_MACCATALYST + #define IS_UIDEVICE_AVAILABLE 1 +#else + #define IS_UIDEVICE_AVAILABLE 0 +#endif + +#if IS_UIDEVICE_AVAILABLE + #import +#endif @interface MKVoiceProcessingDevice () { @public @@ -24,6 +34,7 @@ @interface MKVoiceProcessingDevice () { } @end +#if IS_UIDEVICE_AVAILABLE // DeviceIsRunningiOS7OrGreater returns YES if // the iOS device is on iOS 7 or greater. static BOOL DeviceIsRunningiOS7OrGreater() { @@ -38,6 +49,7 @@ static BOOL DeviceIsRunningiOS7OrGreater() { } return iOS7OrGreater; } +#endif static OSStatus inputCallback(void *udata, AudioUnitRenderActionFlags *flags, const AudioTimeStamp *ts, UInt32 busnum, UInt32 nframes, AudioBufferList *buflist) { From 2218e7b1ab0e5bc7497de6023e801809aca2307f Mon Sep 17 00:00:00 2001 From: Byeong Gwan Date: Sat, 24 Aug 2024 12:06:01 +0900 Subject: [PATCH 3/3] use xcode 14 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 635822e..f1f3f8e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ jobs: submodules: 'recursive' - uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: '13.1' + xcode-version: '14' - name: Build run: | gem install --verbose xcpretty