Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[macOS] How to add fallbacks for AudioComponent in a better way? (to fix build on 10.5) #898

Open
barracuda156 opened this issue Oct 4, 2024 · 9 comments

Comments

@barracuda156
Copy link

This error is confirmed on 10.5.8 with gcc13/gcc14:

:info:build [  4%] Building CXX object CMakeFiles/abaddon.dir/src/audio/ma_impl.cpp.o
:info:build /opt/local/bin/g++-mp-14 -DABADDON_IS_BIG_ENDIAN -DENABLE_NOTIFICATION_SOUNDS -DFMT_SHARED -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DSPDLOG_SHARED_LIB -DWITH_LIBHANDY -DWITH_MINIAUDIO -DWITH_RNNOISE -DWITH_VOICE -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/src -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/build -I/opt/local/include/gtkmm-3.0 -I/opt/local/lib/gtkmm-3.0/include -I/opt/local/include/gdkmm-3.0 -I/opt/local/lib/gdkmm-3.0/include -I/opt/local/include/gtk-3.0 -I/opt/local/include/gdk-pixbuf-2.0 -I/opt/local/include/glibmm-2.4 -I/opt/local/lib/glibmm-2.4/include -I/opt/local/include/giomm-2.4 -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/lib/giomm-2.4/include -I/opt/local/include/pangomm-1.4 -I/opt/local/lib/pangomm-1.4/include -I/opt/local/include/pango-1.0 -I/opt/local/include/harfbuzz -I/opt/local/include/cairo -I/opt/local/include/freetype2 -I/opt/local/include/cairomm-1.0 -I/opt/local/lib/cairomm-1.0/include -I/opt/local/include/atkmm-1.6 -I/opt/local/lib/atkmm-1.6/include -I/opt/local/include/atk-1.0 -I/opt/local/include/sigc++-2.0 -I/opt/local/lib/sigc++-2.0/include -I/opt/local/include/libhandy-1 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio -isystem /opt/local/include -isystem /opt/local/include/libfmt10 -isystem /opt/local/include/opus -pipe -I/opt/local/libexec/openssl3/include -Os -DNDEBUG -I/opt/local/libexec/openssl3/include -isystem/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0 -std=gnu++17 -arch ppc -mmacosx-version-min=10.5 -MD -MT CMakeFiles/abaddon.dir/src/audio/ma_impl.cpp.o -MF CMakeFiles/abaddon.dir/src/audio/ma_impl.cpp.o.d -o CMakeFiles/abaddon.dir/src/audio/ma_impl.cpp.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/src/audio/ma_impl.cpp
:info:build In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/src/audio/ma_impl.cpp:6:
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:31948:9: error: ISO C++ forbids declaration of 'AudioComponent' with no type [-fpermissive]
:info:build 31948 | typedef AudioComponent (* ma_AudioComponentFindNext_proc)(AudioComponent inComponent, const AudioComponentDescription* inDesc);
:info:build       |         ^~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:31948:9: error: typedef 'AudioComponent' is initialized (use 'decltype' instead)
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:31948:27: error: 'ma_AudioComponentFindNext_proc' was not declared in this scope
:info:build 31948 | typedef AudioComponent (* ma_AudioComponentFindNext_proc)(AudioComponent inComponent, const AudioComponentDescription* inDesc);
:info:build       |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:31949:21: error: typedef 'ma_AudioComponentInstanceDispose_proc' is initialized (use 'decltype' instead)
:info:build 31949 | typedef OSStatus (* ma_AudioComponentInstanceDispose_proc)(AudioComponentInstance inInstance);
:info:build       |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:31949:60: error: 'AudioComponentInstance' was not declared in this scope; did you mean 'badComponentInstance'?
:info:build 31949 | typedef OSStatus (* ma_AudioComponentInstanceDispose_proc)(AudioComponentInstance inInstance);
:info:build       |                                                            ^~~~~~~~~~~~~~~~~~~~~~
:info:build       |                                                            badComponentInstance
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:31950:21: error: typedef 'ma_AudioComponentInstanceNew_proc' is initialized (use 'decltype' instead)
:info:build 31950 | typedef OSStatus (* ma_AudioComponentInstanceNew_proc)(AudioComponent inComponent, AudioComponentInstance* outInstance);
:info:build       |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:31950:56: error: 'AudioComponent' was not declared in this scope; did you mean 'AudioFileComponent'?
:info:build 31950 | typedef OSStatus (* ma_AudioComponentInstanceNew_proc)(AudioComponent inComponent, AudioComponentInstance* outInstance);
:info:build       |                                                        ^~~~~~~~~~~~~~
:info:build       |                                                        AudioFileComponent
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:31950:84: error: 'AudioComponentInstance' was not declared in this scope; did you mean 'badComponentInstance'?
:info:build 31950 | typedef OSStatus (* ma_AudioComponentInstanceNew_proc)(AudioComponent inComponent, AudioComponentInstance* outInstance);
:info:build       |                                                                                    ^~~~~~~~~~~~~~~~~~~~~~
:info:build       |                                                                                    badComponentInstance
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:31950:108: error: 'outInstance' was not declared in this scope; did you mean 'NoteInstanceID'?
:info:build 31950 | typedef OSStatus (* ma_AudioComponentInstanceNew_proc)(AudioComponent inComponent, AudioComponentInstance* outInstance);
:info:build       |                                                                                                            ^~~~~~~~~~~
:info:build       |                                                                                                            NoteInstanceID
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h: In function 'ma_result ma_device_uninit__coreaudio(ma_device*)':
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34150:11: error: 'ma_AudioComponentInstanceDispose_proc' was not declared in this scope
:info:build 34150 |         ((ma_AudioComponentInstanceDispose_proc)pDevice->pContext->coreaudio.AudioComponentInstanceDispose)((AudioUnit)pDevice->coreaudio.audioUnitCapture);
:info:build       |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34150:49: error: expected ')' before 'pDevice'
:info:build 34150 |         ((ma_AudioComponentInstanceDispose_proc)pDevice->pContext->coreaudio.AudioComponentInstanceDispose)((AudioUnit)pDevice->coreaudio.audioUnitCapture);
:info:build       |         ~                                       ^~~~~~~
:info:build       |                                                 )
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34153:11: error: 'ma_AudioComponentInstanceDispose_proc' was not declared in this scope
:info:build 34153 |         ((ma_AudioComponentInstanceDispose_proc)pDevice->pContext->coreaudio.AudioComponentInstanceDispose)((AudioUnit)pDevice->coreaudio.audioUnitPlayback);
:info:build       |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34153:49: error: expected ')' before 'pDevice'
:info:build 34153 |         ((ma_AudioComponentInstanceDispose_proc)pDevice->pContext->coreaudio.AudioComponentInstanceDispose)((AudioUnit)pDevice->coreaudio.audioUnitPlayback);
:info:build       |         ~                                       ^~~~~~~
:info:build       |                                                 )
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h: At global scope:
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34183:5: error: 'AudioComponent' does not name a type; did you mean 'AudioFileComponent'?
:info:build 34183 |     AudioComponent component;
:info:build       |     ^~~~~~~~~~~~~~
:info:build       |     AudioFileComponent
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h: In function 'ma_result ma_device_init_internal__coreaudio(ma_context*, ma_device_type, const ma_device_id*, ma_device_init_internal_data__coreaudio*, void*)':
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34218:12: error: 'struct ma_device_init_internal_data__coreaudio' has no member named 'component'
:info:build 34218 |     pData->component = NULL;
:info:build       |            ^~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34242:16: error: 'ma_AudioComponentInstanceNew_proc' was not declared in this scope
:info:build 34242 |     status = ((ma_AudioComponentInstanceNew_proc)pContext->coreaudio.AudioComponentInstanceNew)((AudioComponent)pContext->coreaudio.component, (AudioUnit*)&pData->audioUnit);
:info:build       |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34242:50: error: expected ')' before 'pContext'
:info:build 34242 |     status = ((ma_AudioComponentInstanceNew_proc)pContext->coreaudio.AudioComponentInstanceNew)((AudioComponent)pContext->coreaudio.component, (AudioUnit*)&pData->audioUnit);
:info:build       |              ~                                   ^~~~~~~~
:info:build       |                                                  )
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34256:11: error: 'ma_AudioComponentInstanceDispose_proc' was not declared in this scope
:info:build 34256 |         ((ma_AudioComponentInstanceDispose_proc)pContext->coreaudio.AudioComponentInstanceDispose)(pData->audioUnit);
:info:build       |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34256:49: error: expected ')' before 'pContext'
:info:build 34256 |         ((ma_AudioComponentInstanceDispose_proc)pContext->coreaudio.AudioComponentInstanceDispose)(pData->audioUnit);
:info:build       |         ~                                       ^~~~~~~~
:info:build       |                                                 )
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34263:11: error: 'ma_AudioComponentInstanceDispose_proc' was not declared in this scope
:info:build 34263 |         ((ma_AudioComponentInstanceDispose_proc)pContext->coreaudio.AudioComponentInstanceDispose)(pData->audioUnit);
:info:build       |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34263:49: error: expected ')' before 'pContext'
:info:build 34263 |         ((ma_AudioComponentInstanceDispose_proc)pContext->coreaudio.AudioComponentInstanceDispose)(pData->audioUnit);
:info:build       |         ~                                       ^~~~~~~~
:info:build       |                                                 )
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34272:11: error: 'ma_AudioComponentInstanceDispose_proc' was not declared in this scope
:info:build 34272 |         ((ma_AudioComponentInstanceDispose_proc)pContext->coreaudio.AudioComponentInstanceDispose)(pData->audioUnit);
:info:build       |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34272:49: error: expected ')' before 'pContext'
:info:build 34272 |         ((ma_AudioComponentInstanceDispose_proc)pContext->coreaudio.AudioComponentInstanceDispose)(pData->audioUnit);
:info:build       |         ~                                       ^~~~~~~~
:info:build       |                                                 )
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34323:15: error: 'ma_AudioComponentInstanceDispose_proc' was not declared in this scope
:info:build 34323 |             ((ma_AudioComponentInstanceDispose_proc)pContext->coreaudio.AudioComponentInstanceDispose)(pData->audioUnit);
:info:build       |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34323:53: error: expected ')' before 'pContext'
:info:build 34323 |             ((ma_AudioComponentInstanceDispose_proc)pContext->coreaudio.AudioComponentInstanceDispose)(pData->audioUnit);
:info:build       |             ~                                       ^~~~~~~~
:info:build       |                                                     )
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34330:15: error: 'ma_AudioComponentInstanceDispose_proc' was not declared in this scope
:info:build 34330 |             ((ma_AudioComponentInstanceDispose_proc)pContext->coreaudio.AudioComponentInstanceDispose)(pData->audioUnit);
:info:build       |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34330:53: error: expected ')' before 'pContext'
:info:build 34330 |             ((ma_AudioComponentInstanceDispose_proc)pContext->coreaudio.AudioComponentInstanceDispose)(pData->audioUnit);
:info:build       |             ~                                       ^~~~~~~~
:info:build       |                                                     )
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34422:15: error: 'ma_AudioComponentInstanceDispose_proc' was not declared in this scope
:info:build 34422 |             ((ma_AudioComponentInstanceDispose_proc)pContext->coreaudio.AudioComponentInstanceDispose)(pData->audioUnit);
:info:build       |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34422:53: error: expected ')' before 'pContext'
:info:build 34422 |             ((ma_AudioComponentInstanceDispose_proc)pContext->coreaudio.AudioComponentInstanceDispose)(pData->audioUnit);
:info:build       |             ~                                       ^~~~~~~~
:info:build       |                                                     )
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34427:15: error: 'ma_AudioComponentInstanceDispose_proc' was not declared in this scope
:info:build 34427 |             ((ma_AudioComponentInstanceDispose_proc)pContext->coreaudio.AudioComponentInstanceDispose)(pData->audioUnit);
:info:build       |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34427:53: error: expected ')' before 'pContext'
:info:build 34427 |             ((ma_AudioComponentInstanceDispose_proc)pContext->coreaudio.AudioComponentInstanceDispose)(pData->audioUnit);
:info:build       |             ~                                       ^~~~~~~~
:info:build       |                                                     )
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34513:11: error: 'ma_AudioComponentInstanceDispose_proc' was not declared in this scope
:info:build 34513 |         ((ma_AudioComponentInstanceDispose_proc)pContext->coreaudio.AudioComponentInstanceDispose)(pData->audioUnit);
:info:build       |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34513:49: error: expected ')' before 'pContext'
:info:build 34513 |         ((ma_AudioComponentInstanceDispose_proc)pContext->coreaudio.AudioComponentInstanceDispose)(pData->audioUnit);
:info:build       |         ~                                       ^~~~~~~~
:info:build       |                                                 )
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34526:15: error: 'ma_AudioComponentInstanceDispose_proc' was not declared in this scope
:info:build 34526 |             ((ma_AudioComponentInstanceDispose_proc)pContext->coreaudio.AudioComponentInstanceDispose)(pData->audioUnit);
:info:build       |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34526:53: error: expected ')' before 'pContext'
:info:build 34526 |             ((ma_AudioComponentInstanceDispose_proc)pContext->coreaudio.AudioComponentInstanceDispose)(pData->audioUnit);
:info:build       |             ~                                       ^~~~~~~~
:info:build       |                                                     )
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34539:15: error: 'ma_AudioComponentInstanceDispose_proc' was not declared in this scope
:info:build 34539 |             ((ma_AudioComponentInstanceDispose_proc)pContext->coreaudio.AudioComponentInstanceDispose)(pData->audioUnit);
:info:build       |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34539:53: error: expected ')' before 'pContext'
:info:build 34539 |             ((ma_AudioComponentInstanceDispose_proc)pContext->coreaudio.AudioComponentInstanceDispose)(pData->audioUnit);
:info:build       |             ~                                       ^~~~~~~~
:info:build       |                                                     )
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34546:15: error: 'ma_AudioComponentInstanceDispose_proc' was not declared in this scope
:info:build 34546 |             ((ma_AudioComponentInstanceDispose_proc)pContext->coreaudio.AudioComponentInstanceDispose)(pData->audioUnit);
:info:build       |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34546:53: error: expected ')' before 'pContext'
:info:build 34546 |             ((ma_AudioComponentInstanceDispose_proc)pContext->coreaudio.AudioComponentInstanceDispose)(pData->audioUnit);
:info:build       |             ~                                       ^~~~~~~~
:info:build       |                                                     )
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34555:15: error: 'ma_AudioComponentInstanceDispose_proc' was not declared in this scope
:info:build 34555 |             ((ma_AudioComponentInstanceDispose_proc)pContext->coreaudio.AudioComponentInstanceDispose)(pData->audioUnit);
:info:build       |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34555:53: error: expected ')' before 'pContext'
:info:build 34555 |             ((ma_AudioComponentInstanceDispose_proc)pContext->coreaudio.AudioComponentInstanceDispose)(pData->audioUnit);
:info:build       |             ~                                       ^~~~~~~~
:info:build       |                                                     )
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34565:11: error: 'ma_AudioComponentInstanceDispose_proc' was not declared in this scope
:info:build 34565 |         ((ma_AudioComponentInstanceDispose_proc)pContext->coreaudio.AudioComponentInstanceDispose)(pData->audioUnit);
:info:build       |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34565:49: error: expected ')' before 'pContext'
:info:build 34565 |         ((ma_AudioComponentInstanceDispose_proc)pContext->coreaudio.AudioComponentInstanceDispose)(pData->audioUnit);
:info:build       |         ~                                       ^~~~~~~~
:info:build       |                                                 )
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h: In function 'ma_result ma_device_reinit_internal__coreaudio(ma_device*, ma_device_type, ma_bool32)':
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34607:15: error: 'ma_AudioComponentInstanceDispose_proc' was not declared in this scope
:info:build 34607 |             ((ma_AudioComponentInstanceDispose_proc)pDevice->pContext->coreaudio.AudioComponentInstanceDispose)((AudioUnit)pDevice->coreaudio.audioUnitCapture);
:info:build       |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34607:53: error: expected ')' before 'pDevice'
:info:build 34607 |             ((ma_AudioComponentInstanceDispose_proc)pDevice->pContext->coreaudio.AudioComponentInstanceDispose)((AudioUnit)pDevice->coreaudio.audioUnitCapture);
:info:build       |             ~                                       ^~~~~~~
:info:build       |                                                     )
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34623:15: error: 'ma_AudioComponentInstanceDispose_proc' was not declared in this scope
:info:build 34623 |             ((ma_AudioComponentInstanceDispose_proc)pDevice->pContext->coreaudio.AudioComponentInstanceDispose)((AudioUnit)pDevice->coreaudio.audioUnitPlayback);
:info:build       |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34623:53: error: expected ')' before 'pDevice'
:info:build 34623 |             ((ma_AudioComponentInstanceDispose_proc)pDevice->pContext->coreaudio.AudioComponentInstanceDispose)((AudioUnit)pDevice->coreaudio.audioUnitPlayback);
:info:build       |             ~                                       ^~~~~~~
:info:build       |                                                     )
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h: In function 'ma_result ma_device_init__coreaudio(ma_device*, const ma_device_config*, ma_device_descriptor*, ma_device_descriptor*)':
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34774:19: error: 'ma_AudioComponentInstanceDispose_proc' was not declared in this scope
:info:build 34774 |                 ((ma_AudioComponentInstanceDispose_proc)pDevice->pContext->coreaudio.AudioComponentInstanceDispose)((AudioUnit)pDevice->coreaudio.audioUnitCapture);
:info:build       |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:34774:57: error: expected ')' before 'pDevice'
:info:build 34774 |                 ((ma_AudioComponentInstanceDispose_proc)pDevice->pContext->coreaudio.AudioComponentInstanceDispose)((AudioUnit)pDevice->coreaudio.audioUnitCapture);
:info:build       |                 ~                                       ^~~~~~~
:info:build       |                                                         )
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h: In function 'ma_result ma_context_init__coreaudio(ma_context*, const ma_context_config*, ma_backend_callbacks*)':
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:35056:70: error: 'AudioComponentFindNext' was not declared in this scope
:info:build 35056 |     pContext->coreaudio.AudioComponentFindNext            = (ma_proc)AudioComponentFindNext;
:info:build       |                                                                      ^~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:35057:70: error: 'AudioComponentInstanceDispose' was not declared in this scope
:info:build 35057 |     pContext->coreaudio.AudioComponentInstanceDispose     = (ma_proc)AudioComponentInstanceDispose;
:info:build       |                                                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:35058:70: error: 'AudioComponentInstanceNew' was not declared in this scope; did you mean 'badComponentInstance'?
:info:build 35058 |     pContext->coreaudio.AudioComponentInstanceNew         = (ma_proc)AudioComponentInstanceNew;
:info:build       |                                                                      ^~~~~~~~~~~~~~~~~~~~~~~~~
:info:build       |                                                                      badComponentInstance
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:35071:9: error: 'AudioComponentDescription' was not declared in this scope; did you mean 'ComponentDescription'?
:info:build 35071 |         AudioComponentDescription desc;
:info:build       |         ^~~~~~~~~~~~~~~~~~~~~~~~~
:info:build       |         ComponentDescription
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:35072:9: error: 'desc' was not declared in this scope
:info:build 35072 |         desc.componentType         = kAudioUnitType_Output;
:info:build       |         ^~~~
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:35082:43: error: 'ma_AudioComponentFindNext_proc' was not declared in this scope
:info:build 35082 |         pContext->coreaudio.component = ((ma_AudioComponentFindNext_proc)pContext->coreaudio.AudioComponentFindNext)(NULL, &desc);
:info:build       |                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_abaddon/abaddon/work/abaddon-0.2.1/subprojects/miniaudio/miniaudio.h:35082:74: error: expected ')' before 'pContext'
:info:build 35082 |         pContext->coreaudio.component = ((ma_AudioComponentFindNext_proc)pContext->coreaudio.AudioComponentFindNext)(NULL, &desc);
:info:build       |                                         ~                                ^~~~~~~~
:info:build       |                                                                          )
:info:build make[2]: *** [CMakeFiles/abaddon.dir/src/audio/ma_impl.cpp.o] Error 1

The build uses miniaudio from 88436b2 commit. As a matter of fact, that did work on my 10.6 ppc somehow, at least when the port was updated last time.

It looks like AudioComponent and AudioComponentInstance exit only on 10.12+:
https://developer.apple.com/documentation/audiotoolbox/audiocomponent
https://developer.apple.com/documentation/audiotoolbox/audiocomponentinstance
Which means they cannot be present in 10.6 ppc either.

AudioComponentInstanceDispose is supported in 10.6+, however, so probably exists in 10.6 ppc, but not in 10.5.8: https://developer.apple.com/documentation/audiotoolbox/1410508-audiocomponentinstancedispose

See also: https://trac.macports.org/ticket/70289#comment:11 (and the log attached there).

@mackron Could you suggest how to address this in a better way?

@barracuda156
Copy link
Author

Hmm, Apple documentation may actually be wrong on this, which explains why I had no errors on 10.6 ppc.
And something like this patch should fix the problem: macports/macports-ports@8ef9fd7

@barracuda156 barracuda156 changed the title [macOS] AudioToolbox-related errors on 10.5.8: error: ISO C++ forbids declaration of 'AudioComponent' with no type [-fpermissive] etc. [macOS] How to add fallbacks for AudioComponent in a better way? (to fix build on 10.5) Oct 4, 2024
@barracuda156
Copy link
Author

@mackron I guess we have the fix in principle, we just need to decide how to add it in a neat way.
If you advise on that, I will handle technical side and make a PR.

@barracuda156
Copy link
Author

barracuda156 commented Oct 4, 2024

The difference is that functions to use on 10.5 are from Core Services, not CoreAudio, like: https://developer.apple.com/documentation/coreservices/1516552-findnextcomponent

Just to get a picture where we have related stuff, see: barracuda156@01aeaac
I am pretty sure this will not work, and it is blind and mechanical now. So this is not a patch, but rather a pointer at what we deal with.

@mackron
Copy link
Owner

mackron commented Oct 6, 2024

Thanks. I'm actually not sure on the best solution to be honest. Apple is a platform that I lean on the community quite heavily so I'd be happy to take your advice. And I do indeed like to support old operating systems (miniaudio supports Windows 95) so I'm receptive to this change, just so long as there's no ill effects towards modern systems.

@barracuda156
Copy link
Author

@RJVB Could you take a quick look at this? Maybe you can suggest the right way to fix it. (I think you do not have 10.5 installed, but I can ask someone to run the build with a patch applied. The issue is not arch-specific and not related to 10.6 ppc.)

@RJVB
Copy link

RJVB commented Oct 7, 2024

A quick look isn't going to be of much help I'm afraid because all that makes me think is something like "erm, too complicated, too long a log to wade through, sorry, not concerned enough".

10.12+ is mentioned, so this application is presumably not going to build on 10.9 either ... but my system headers seem to define AudioComponent types?!
EDIT in the AudioUnit framework. Maybe that helps?

If CoreServices.framework still exists on modern OS versions the simplest way to address the which-library question is to link it in unconditionally. Chances are it'll get pulled in at runtime anyway and even if not it shouldn't bite or add an impossible amount of overhead.

The question to be answered first (don't think I've seen that here) is what those new/missing functions are used for in miniaudio, if they're indispensable and if so, how they can be replaced on older systems. I don't really know how to answer that (but there is a CoreAudio mailing list...)

@mackron
Copy link
Owner

mackron commented Oct 7, 2024

The draft PR you mentioned looks reasonable enough in concept to me. A few things are questionable, particularly this part:

#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 /* Legacy fallback */
    pContext->coreaudio.FindNextComponent                 = ma_dlsym(ma_context_get_log(pContext), pContext->coreaudio.hAudioUnit, "AudioComponentFindNext");
    pContext->coreaudio.CloseComponent                    = ma_dlsym(ma_context_get_log(pContext), pContext->coreaudio.hAudioUnit, "AudioComponentInstanceDispose");
    pContext->coreaudio.OpenAComponent                    = ma_dlsym(ma_context_get_log(pContext), pContext->coreaudio.hAudioUnit, "AudioComponentInstanceNew");
#else

Looks like a copy/paste error? Setting a function pointer called FindNextComponent, but the function being retrieved from dlsym() is AudioComponentFindNext? And it's also being retrieved from hAudioUnit which looks incorrect? The naming of ma_AudioComponentFindNext_proc should not be used for the function FindNextComponent either - I'd rather that be consistent.

Regardless, if you like you can submit a PR and we can talk about it further from there. I won't have a way to test this personally though.

@barracuda156
Copy link
Author

@RJVB Thank you for responding!

10.12+ is mentioned, so this application is presumably not going to build on 10.9 either ... but my system headers seem to define AudioComponent types?! EDIT in the AudioUnit framework. Maybe that helps?

It looks like Apple docs are wrong on that, and all AudioComponent stuff is present in 10.6+. That seems to be a conclusion of https://trac.macports.org/ticket/63230 and it explains why I never saw these error on my 10.6 ppc.

(An unrelated issue on < 10.8 was fixed earlier in 6700c7e and with that the build worked fine on 10.6+.)

The question to be answered first (don't think I've seen that here) is what those new/missing functions are used for in miniaudio, if they're indispensable and if so, how they can be replaced on older systems. I don't really know how to answer that (but there is a CoreAudio mailing list...)

At least at the moment miniaudio in MacPorts is used only when building a Discord client abaddon. Given that anything audio- or voice communication-related is not the primary functionality for Discord, risks are low: in the worst case we do not have a working audio on 10.5, but that can be improved upon subsequently.
I cannot test this on 10.5 myself any time soon either, but fixing the build itself at least will be really useful.

@barracuda156
Copy link
Author

@mackron Yes, that was just a mechanical copy-paste (which is why I did not open a PR) simply to highlight instances to deal with. I have no idea of CoreAudio internals, will try to figure out how to make a reasonable fix. (I won’t be able to test it myself on 10.5, though perhaps I can artificially force a fallback to be used on 10.6 to see if that works. But in about two weeks time, since no access to the hardware until then.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants