Open4

Reposoup: Android NDKにC++でないと使えないヘッダがある謎

okuokuokuoku

android/performance_hint.h

bool が無い。これは stdbool.h が必要。C23では bool が標準に取り込まれたので要らなくなる。

android/performance_hint.h:223:9: error: unknown type name 'bool'
  223 |         bool enabled) __INTRODUCED_IN(__ANDROID_API_V__);
      |         ^
okuokuokuoku

android/surface_control.h

参照渡し。

android/surface_control.h:393:92: error: expected ')'
  393 |                                      ASurfaceControl* _Nonnull surface_control, const ARect& source,
      |   
okuokuokuoku

android/thermal.h

Cでは事前に typedef enum しておく必要がある。

android/thermal.h:114:53: error: must use 'enum' tag to refer to type 'AThermalStatus'
  114 | typedef void (*AThermal_StatusCallback)(void* data, AThermalStatus status);
      |                                                     ^