binder_status.h: include assert.h for __assert
The binder_status.h header is defining __assert as a macro for its own error reporting, which conflicts with glibc's unused __assert function. Android's version of glibc 2.17's assert.h has an _ASSERT_H_DECLS guard macro preventing redeclaration of the __assert function, so if we add an include of assert.h in binder_status.h, the __assert function can be declared before the identifier is shadowed by the macro, and later assert.h inclusions won't redeclare __assert (even though they *do* redefine assert according to the current value of NDEBUG). Without this fix, after upgrading libc++, assert.h is incidentally included somewhere *after* binder_status.h, and binder's __assert macro is applied to the __assert declaration in the glibc header, which is invalid syntax. Bug: 175635923 Test: m art_artd_tests Change-Id: I35c197b8d92ecad417a7e9950f51461375d3861f
Loading
Please register or sign in to comment