From e2c51809f70387a6ceddc89966b48aaee17ac402 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Mon, 17 Jul 2017 16:25:59 -0700 Subject: [PATCH 1/2] Add sys/cdefs.h to log/log_main.h. for liblog.vendor. __ANDROID_API__ is __ANDROID_API_FUTURE__ with BOARD_VNDK_VERSION=current, so we need it defined. Bug: 33241851 Test: BOARD_VNDK_VERSION=current m libgui.vendor (that uses liblog.vendor) Change-Id: I340ec048094c027828f516d891250651e0c88eea Merged-In: I340ec048094c027828f516d891250651e0c88eea --- liblog/include/log/log_main.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/liblog/include/log/log_main.h b/liblog/include/log/log_main.h index 5a3f04ca8..339a06d86 100644 --- a/liblog/include/log/log_main.h +++ b/liblog/include/log/log_main.h @@ -18,10 +18,9 @@ #define _LIBS_LOG_LOG_MAIN_H #include +#include -#ifdef __cplusplus -extern "C" { -#endif +__BEGIN_DECLS /* * Normally we strip the effects of ALOGV (VERBOSE messages), @@ -385,8 +384,6 @@ int __android_log_is_loggable_len(int prio, const char* tag, size_t len, #pragma clang diagnostic pop #endif -#ifdef __cplusplus -} -#endif +__END_DECLS #endif /* _LIBS_LOG_LOG_MAIN_H */ From 25db8dc21b37ae93e2d764aff86445781aa9d185 Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Mon, 10 Jul 2017 16:40:36 -0700 Subject: [PATCH 2/2] Add vendor_available to liblog_headers. Renamed NDK headers to "liblog_ndk_headers" (these names aren't used anywhere). libutils_headers now properly export liblog_headers. Test: with BOARD_VNDK_VERSION=current Change-Id: I7b2d9e77e313e3f2ef362a19a03f4c23874d589a Merged-In: I3a85385f588b84393c57fd6d1bcac620f708f0f1 --- liblog/Android.bp | 23 +++++++++++++++++++++-- libutils/Android.bp | 2 ++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/liblog/Android.bp b/liblog/Android.bp index e74aa8283..b98d18ff6 100644 --- a/liblog/Android.bp +++ b/liblog/Android.bp @@ -42,6 +42,24 @@ liblog_target_sources = [ "logd_writer.c", ] +cc_library_headers { + name: "liblog_headers", + host_supported: true, + vendor_available: true, + export_include_dirs: ["include"], + target: { + windows: { + enabled: true, + }, + linux_bionic: { + enabled: true, + }, + vendor: { + export_include_dirs: ["include_vndk"], + }, + }, +} + // Shared and static library for host and device // ======================================================== cc_library { @@ -81,7 +99,8 @@ cc_library { }, }, - export_include_dirs: ["include"], + header_libs: ["liblog_headers"], + export_header_lib_headers: ["liblog_headers"], cflags: [ "-Werror", @@ -100,7 +119,7 @@ cc_library { } ndk_headers { - name: "liblog_headers", + name: "liblog_ndk_headers", from: "include/android", to: "android", srcs: ["include/android/log.h"], diff --git a/libutils/Android.bp b/libutils/Android.bp index adcde819c..038fd73f9 100644 --- a/libutils/Android.bp +++ b/libutils/Android.bp @@ -18,10 +18,12 @@ cc_library_headers { host_supported: true, header_libs: [ + "liblog_headers", "libsystem_headers", "libcutils_headers" ], export_header_lib_headers: [ + "liblog_headers", "libsystem_headers", "libcutils_headers" ],