Skip to content

Conversation

@sophiapoirier
Copy link

The Expected value macros AUSDK_UnwrapOrReturnError, AUSDK_UnwrapOrReturnVoid, and AUSDK_UnwrapOrReturnUnexpected aren't well encapsulated with parentheses around their bodies, making them unusable in expressions dereferencing the value results, e.g.:

AUSDK_UnwrapOrReturnError(GetOutput0().GetBufferListOrError()).mNumberBuffers;

reduced error messages:

error: no member named 'mNumberBuffers' in 'ausdk::ExpectedPtr<AudioBufferList>'; did you mean to use '->' instead of '.'?
 1656 |         AUSDK_UnwrapOrReturnError(theOutput.GetBufferListOrError()).mNumberBuffers;
      |                                                                                                  ^
      |                                                                                                  ->
error: indirection requires pointer operand ('UInt32' (aka 'unsigned int') invalid)
 1656 |         AUSDK_UnwrapOrReturnError(theOutput.GetBufferListOrError()).mNumberBuffers;
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
AudioUnitSDK/include/AudioUnitSDK/AUUtility.h:80:2: note: expanded from macro 'AUSDK_UnwrapOrReturnError'
   80 |         *({                                                                                           \
      |         ^
  • [X ] I understand that response time may be limited because the project doesn't accept pull requests.
  • [ X] I agree to the terms outlined in CONTRIBUTING.md

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

Successfully merging this pull request may close these issues.

1 participant