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

[question/might be a BUG] AAudio.h:809:9: error: unknown type name 'bool' in NDK 21d #1281

Closed
planethcom opened this issue Jun 12, 2020 · 11 comments
Assignees
Labels
Projects

Comments

@planethcom
Copy link

Since NDK 21d (21.3.6528147), I'm getting the following compiler error:

.....\21.3.6528147\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\aaudio\AAudio.h:809:9: error: unknown type name 'bool'

The same setup worked well with NDK 21c (21.2.6472646) and below.
Any help would be welcome.
Thanks in advance

@enh-google
Copy link
Collaborator

i note that although many of our header files use bool almost none of them #include <stdbool.h> so they'll work from C as well as C++ source.

<math.h> is a false positive (it mentions bool in a comment), and others get <stdbool.h> via transitive include, but this gives an idea:

--- /tmp/uses-bool	2020-06-12 08:12:21.000000000 -0700
+++ /tmp/includes-stdbool	2020-06-12 08:12:35.000000000 -0700
@@ -1,22 +1,12 @@
-./EGL/Platform.h
-./android/NeuralNetworks.h
-./android/binder_auto_utils.h
-./android/binder_ibinder.h
-./android/binder_interface_utils.h
-./android/binder_parcel.h
-./android/binder_parcel_utils.h
-./android/binder_status.h
+./android/dlext.h
+./android/fdsan.h
 ./android/font.h
 ./android/font_matcher.h
 ./android/sensor.h
+./android/system_fonts.h
 ./android/trace.h
 ./bits/stdatomic.h
 ./camera/NdkCameraCaptureSession.h
-./camera/NdkCameraMetadata.h
-./math.h
-./media/NdkMediaCodec.h
 ./media/NdkMediaCrypto.h
 ./media/NdkMediaDrm.h
-./media/NdkMediaExtractor.h
-./media/NdkMediaFormat.h
 ./sys/system_properties.h

(the + lines are files that include <stdbool.h> but don't use bool. of course we have some of them too.)

@enh-google
Copy link
Collaborator

(just to be explicit: your short-term workaround is #include <stdbool.h> before you include AAudio.h.)

@planethcom
Copy link
Author

(just to be explicit: your short-term workaround is #include <stdbool.h> before you include AAudio.h.)

That worked well, at least as a workaround for now.
Thanks a lot

@planethcom
Copy link
Author

Thank you very much for the prompt reaction. Much appreciated!

@philburk
Copy link

@enh-google
Copy link
Collaborator

the audio API isn't in AOSP yet

AAudio is in AOSP at:
https://android.googlesource.com/platform/frameworks/av/+/refs/heads/master/media/libaaudio/include/aaudio

aye, but the specific new API that uses bool isn't in AOSP yet :-)

@DanAlbert DanAlbert added this to the r21e milestone Jun 12, 2020
Jackeagle pushed a commit to Jackeagle/caf_frameworks_av that referenced this issue Jun 13, 2020
Bug: android/ndk#1281
Test: treehugger
Change-Id: Ibba9b1b03e92da8a664145a269732c638b2ec550
Jackeagle pushed a commit to Jackeagle/caf_frameworks_native that referenced this issue Jun 17, 2020
...to files with C API using bool.

(I've left the ones where the only uses of bool are in C++ anyway, since
those headers are obviously not usable from C.)

Bug: android/ndk#1281
Test: treehugger
Change-Id: I616a8482bcdbb391ec8c028d6b6a70b1d9d08960
@DanAlbert DanAlbert self-assigned this Jun 25, 2020
@DanAlbert
Copy link
Member

I think the patches that fix this are in now so I just need to merge them into the r21 sysroot and make the update.

@DanAlbert DanAlbert added this to Needs prebuilt update in r22 Jul 7, 2020
@DanAlbert DanAlbert added this to Needs prebuilt update in r21e Jul 7, 2020
@DanAlbert DanAlbert moved this from Needs prebuilt update to Merged in r22 Oct 1, 2020
@DanAlbert DanAlbert moved this from Needs prebuilt update to Needs cherry-pick in r21e Dec 14, 2020
@DanAlbert DanAlbert moved this from Needs cherry-pick to Merged in r21e Jan 21, 2021
BoredOutOfMyGit pushed a commit to codeaurora-unofficial/platform-frameworks-native that referenced this issue Feb 1, 2021
...to files with C API using bool.

(I've left the ones where the only uses of bool are in C++ anyway, since
those headers are obviously not usable from C.)

Bug: android/ndk#1281
Test: treehugger
Exempt-From-Owner-Approval: Cherry pick to release branch
Change-Id: I616a8482bcdbb391ec8c028d6b6a70b1d9d08960
(cherry picked from commit 09f4184)
@DanAlbert DanAlbert removed this from the r21e milestone Feb 2, 2021
@ericoporto
Copy link

Has this been closed? I am hitting it with NDK 21.3.6528147.

@philburk
Copy link

I see that stdbool.h was added to AAudio.h in this CL on June 12, 2020:

https://android.googlesource.com/platform/frameworks/av/+/9c1fca20c31ad0442e6be8d665dedb2c419a6093%5E%21/#F0

@DanAlbert
Copy link
Member

I am hitting it with NDK 21.3.6528147.

Because that's too old: https://github.com/android/ndk/wiki/Changelog-r21#r21e

You're using r21d.

BtbN pushed a commit to FFmpeg/FFmpeg that referenced this issue Dec 19, 2022
Since NDK failed to do that:
android/ndk#1281

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
littleGnAl pushed a commit to littleGnAl/mirror_platform_frameworks_av that referenced this issue Feb 9, 2024
Bug: android/ndk#1281
Test: treehugger
Change-Id: Ibba9b1b03e92da8a664145a269732c638b2ec550
(cherry picked from commit 9dafdd6)
littleGnAl pushed a commit to littleGnAl/mirror_platform_frameworks_av that referenced this issue Feb 9, 2024
Bug: android/ndk#1281
Test: treehugger
Change-Id: Idd009254e41b8b5136bc4d2d9a49c130780f98d5
(cherry picked from commit 9c1fca2)
h7su pushed a commit to h7su/android_platform_frameworks_native that referenced this issue Apr 22, 2024
...to files with C API using bool.

(I've left the ones where the only uses of bool are in C++ anyway, since
those headers are obviously not usable from C.)

Bug: android/ndk#1281
Test: treehugger
Change-Id: I616a8482bcdbb391ec8c028d6b6a70b1d9d08960
(cherry picked from commit 09f4184)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
r21e
  
Merged
r22
  
Merged
Development

No branches or pull requests

5 participants